diff options
Diffstat (limited to 'hasher/blake2-hash_generator.go')
-rw-r--r-- | hasher/blake2-hash_generator.go | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/hasher/blake2-hash_generator.go b/hasher/blake2-hash_generator.go deleted file mode 100644 index e71a736..0000000 --- a/hasher/blake2-hash_generator.go +++ /dev/null @@ -1,30 +0,0 @@ -package hasher - -import ( - "fmt" - "golang.org/x/crypto/blake2b" - "io" - "os" -) - -func CalculateBLAKE2Hash(filePath string) (string, error) { - file, err := os.Open(filePath) - if err != nil { - return "", err - } - defer file.Close() - - hash, err := blake2b.New256(nil) - if err != nil { - return "", err - } - - _, err = io.Copy(hash, file) - if err != nil { - return "", err - } - - hashBytes := hash.Sum(nil) - hashString := fmt.Sprintf("%x", hashBytes) - return hashString, nil -} |