use more official blake2b checksum
This commit is contained in:
parent
1dcebc4eca
commit
62aea5413e
4 changed files with 11 additions and 9 deletions
|
|
@ -2,7 +2,8 @@ package fic
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"crypto/sha1"
|
||||
"crypto"
|
||||
_ "crypto/sha1"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"io"
|
||||
|
|
@ -10,7 +11,7 @@ import (
|
|||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/dchest/blake2b"
|
||||
_ "golang.org/x/crypto/blake2b"
|
||||
)
|
||||
|
||||
var FilesDir string = "./FILES/"
|
||||
|
|
@ -110,8 +111,8 @@ func checkFileHash(filePath string, digest []byte) ([]byte, int64, error) {
|
|||
defer fd.Close()
|
||||
|
||||
reader := bufio.NewReader(fd)
|
||||
hash160 := sha1.New()
|
||||
hash512 := blake2b.New512()
|
||||
hash160 := crypto.SHA1.New()
|
||||
hash512 := crypto.BLAKE2b_512.New()
|
||||
|
||||
w := io.MultiWriter(hash160, hash512)
|
||||
if _, err := io.Copy(w, reader); err != nil {
|
||||
|
|
|
|||
Reference in a new issue