use more official blake2b checksum

This commit is contained in:
nemunaire 2018-02-03 02:03:08 +01:00
parent 1dcebc4eca
commit 62aea5413e
4 changed files with 11 additions and 9 deletions

View file

@ -2,6 +2,7 @@ package sync
import (
"bufio"
"crypto"
"encoding/hex"
"fmt"
"io"
@ -11,7 +12,7 @@ import (
"srs.epita.fr/fic-server/libfic"
"github.com/dchest/blake2b"
_ "golang.org/x/crypto/blake2b"
)
func SyncExerciceHints(i Importer, exercice fic.Exercice) (errs []string) {
@ -52,7 +53,7 @@ func SyncExerciceHints(i Importer, exercice fic.Exercice) (errs []string) {
// Handle big files as downloadable content
if res, err := i.importFile(path.Join(exercice.Path, "hints", hfile), func(filePath string, origin string) (interface{}, error) {
// Calculate hash
hash512 := blake2b.New512()
hash512 := crypto.BLAKE2b_512.New()
if fd, err := os.Open(filePath); err != nil {
return nil, err
} else {