making changes to common library, starting to integrate database functions

This commit is contained in:
2020-06-11 17:24:35 -04:00
parent 0ecb0b96ce
commit d335549fd5
15 changed files with 317 additions and 145 deletions

View File

@@ -0,0 +1,14 @@
package engine
import (
"github.com/kalafut/imohash"
)
// UniqueFileHash creats a fast hash of a file. It's not bullet proof (could cause a collision, but in practice unlikely) but its fast
func UniqueFileHash(src string) ([16]byte, error) {
hash, err := imohash.SumFile(src)
if err != nil {
return [16]byte{}, err
}
return hash, nil
}