X-Git-Url: http://www.git.cypherpunks.ru/?p=goredo.git;a=blobdiff_plain;f=dep.go;h=0c5b6348740393340435a7c81a3d9c85b5274324;hp=df5ae27f2af9737b070b84df719a24f255328d2b;hb=760f49298dd70c3b1e4ba75f9704444b4d94ed1d;hpb=a698abb36d3ab6fa380660ffdf9863dcd47df2ff diff --git a/dep.go b/dep.go index df5ae27..0c5b634 100644 --- a/dep.go +++ b/dep.go @@ -30,8 +30,8 @@ import ( "path/filepath" "go.cypherpunks.ru/recfile" - "golang.org/x/crypto/blake2b" "golang.org/x/sys/unix" + "lukechampine.com/blake3" ) var DirPrefix string @@ -85,11 +85,8 @@ func fileCtime(fd *os.File) (string, error) { } func fileHash(fd *os.File) (string, error) { - h, err := blake2b.New256(nil) - if err != nil { - panic(err) - } - if _, err = io.Copy(h, bufio.NewReader(fd)); err != nil { + h := blake3.New(32, nil) + if _, err := io.Copy(h, bufio.NewReader(fd)); err != nil { return "", err } return hex.EncodeToString(h.Sum(nil)), nil