Documentation
¶
Overview ¶
Description: 用於將文字雜湊化,並比較文字與雜湊後的文字是否相符
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareHash ¶
func CompareHash(textToCompare, hashedBase64, saltBase64 string, hashConfig ...HashConfig) bool
CompareHash 用於比較文字與雜湊後的文字是否相符,您可以傳入 HashConfig 結構體來設定雜湊的參數
Types ¶
type HashConfig ¶
type HashConfig struct { Memory uint32 // 記憶體使用量,以 KB 為單位,預設值為 64 * 1024 Iterations uint32 // 迭代次數,預設值為 3 Threads uint8 // 使用的執行緒數,預設值為 4 CustomSalt []byte // 自訂鹽值,若未指定,則會自動生成 SaltLength uint32 // 鹽值長度,當 CustomSalt 不為空時無效,預設值為 16 KeyLength uint32 // 雜湊後的字串長度,預設值為 32 }
HashConfig 用於設定雜湊的參數
Click to show internal directories.
Click to hide internal directories.