summaryrefslogtreecommitdiff
path: root/hasher
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2023-09-07 22:04:12 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2023-09-07 22:04:12 +0530
commita3ead3d67520704eda55a74841b00d5766728fab (patch)
treea66f042970f48d188e94b746be7641e0ef91d7b1 /hasher
parent48979e3f848ab0159156f87823bc8f3358925523 (diff)
Correctly formatting source files using go fmt
Diffstat (limited to 'hasher')
-rw-r--r--hasher/blake2-hash_generator.go40
1 files changed, 20 insertions, 20 deletions
diff --git a/hasher/blake2-hash_generator.go b/hasher/blake2-hash_generator.go
index 4d85a58..e71a736 100644
--- a/hasher/blake2-hash_generator.go
+++ b/hasher/blake2-hash_generator.go
@@ -1,30 +1,30 @@
package hasher
import (
- "fmt"
- "golang.org/x/crypto/blake2b"
- "io"
- "os"
+ "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()
+ file, err := os.Open(filePath)
+ if err != nil {
+ return "", err
+ }
+ defer file.Close()
- hash, err := blake2b.New256(nil)
- if err != nil {
- return "", err
- }
+ hash, err := blake2b.New256(nil)
+ if err != nil {
+ return "", err
+ }
- _, err = io.Copy(hash, file)
- 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
+ hashBytes := hash.Sum(nil)
+ hashString := fmt.Sprintf("%x", hashBytes)
+ return hashString, nil
}