Replacing murmur3 with internal safe-pointer version
@@ -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
