diff options
author | axtloss <axtlos@getcryst.al> | 2024-02-12 18:55:29 +0100 |
---|---|---|
committer | axtloss <axtlos@getcryst.al> | 2024-02-12 18:55:29 +0100 |
commit | e01c0cf2c84c41841bd7f080a2136c67cf5425b9 (patch) | |
tree | 6f7ee71afeb6de4cee55b97fa0a5eb67452ab8cb /verifysetup/core | |
parent | ae67ea6a67c25fef305964ee34d4bf96b9da8519 (diff) | |
download | fsverify-e01c0cf2c84c41841bd7f080a2136c67cf5425b9.tar.gz fsverify-e01c0cf2c84c41841bd7f080a2136c67cf5425b9.tar.bz2 |
Improve performance
Diffstat (limited to 'verifysetup/core')
-rw-r--r-- | verifysetup/core/crypt.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/verifysetup/core/crypt.go b/verifysetup/core/crypt.go index 77df221..4658641 100644 --- a/verifysetup/core/crypt.go +++ b/verifysetup/core/crypt.go @@ -3,7 +3,7 @@ package core import ( "aead.dev/minisign" "bytes" - "crypto/sha256" + "crypto/sha1" "fmt" "golang.org/x/term" "io" @@ -12,11 +12,11 @@ import ( ) func CalculateBlockHash(block []byte) (string, error) { - hash := sha256.New() + hash := sha1.New() if _, err := io.Copy(hash, bytes.NewReader(block)); err != nil { return "", err } - hashInBytes := hash.Sum(nil)[:32] + hashInBytes := hash.Sum(nil)[:20] return strings.TrimSpace(fmt.Sprintf("%x", hashInBytes)), nil } |