Update dependencies

This commit is contained in:
Manuel de Brito Fontes 2017-10-06 17:33:32 -03:00
parent bf5616c65b
commit d6d374b28d
13962 changed files with 48226 additions and 3618880 deletions

19
pkg/file/file.go Normal file
View file

@ -0,0 +1,19 @@
package file
import (
"crypto/sha1"
"encoding/hex"
"io/ioutil"
)
// SHA1 returns the SHA1 of a file.
func SHA1(filename string) string {
hasher := sha1.New()
s, err := ioutil.ReadFile(filename)
if err != nil {
return ""
}
hasher.Write(s)
return hex.EncodeToString(hasher.Sum(nil))
}