Created animediff package

This commit is contained in:
2018-03-09 05:12:22 +01:00
parent 3ac77b889b
commit 1910b3c2d8
8 changed files with 93 additions and 59 deletions

17
utils/HashStrings.go Normal file
View File

@ -0,0 +1,17 @@
package utils
import "github.com/OneOfOne/xxhash"
// HashStringsNoOrder returns a hash of the string slice contents, ignoring order.
func HashStringsNoOrder(items []string) uint64 {
sum := uint64(0)
for _, item := range items {
h := xxhash.NewS64(0)
h.Write([]byte(item))
numHash := h.Sum64()
sum += numHash
}
return sum
}