use more official blake2b checksum
This commit is contained in:
parent
1dcebc4eca
commit
62aea5413e
4 changed files with 11 additions and 9 deletions
|
@ -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 {
|
||||
|
|
Reference in a new issue