fix(hash): 修正 BLAKE2B 哈希长度配置错误
将 blake2b.New256 替换为 blake2b.New 并传入正确的字节长度参数 28, 以确保生成 224 位的哈希值。同时清理了文件末尾多余的空行。
This commit is contained in:
@@ -15,7 +15,7 @@ import (
|
||||
func hasherSelect(bitSize int) hash.Hash {
|
||||
switch bitSize {
|
||||
case 224:
|
||||
hasher, _ := blake2b.New256(nil)
|
||||
hasher, _ := blake2b.New(28, nil)
|
||||
return hasher
|
||||
case 256:
|
||||
hasher, _ := blake2b.New256(nil)
|
||||
@@ -114,4 +114,4 @@ func SumFileHex(file string, bitSize ...int) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
return hex.EncodeToString(hash), nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user