Replacing murmur3 with internal safe-pointer version

dev
mzack 2022-01-02 09:09:10 +01:00
parent faae9672ab
commit 357916a6e2
1 changed files with 3 additions and 1 deletions

View File

@ -153,7 +153,9 @@ func init() {
return hex.EncodeToString(hash.Sum(nil)), nil
}),
"mmh3": makeDslFunction(1, func(args ...interface{}) (interface{}, error) {
return fmt.Sprintf("%d", int32(murmur3.Sum32WithSeed([]byte(types.ToString(args[0])), 0))), nil
hasher := murmur3.New32WithSeed(0)
hasher.Write([]byte(fmt.Sprint(args[0])))
return fmt.Sprint(hasher.Sum32()), nil
}),
"contains": makeDslFunction(2, func(args ...interface{}) (interface{}, error) {
return strings.Contains(types.ToString(args[0]), types.ToString(args[1])), nil