计算字符串hash nimber

This commit is contained in:
白茶清欢 2024-06-27 11:17:06 +08:00
parent 8d056baada
commit 9ff1c213bb

View File

@ -13,6 +13,7 @@ import (
"errors" "errors"
"git.zhangdeman.cn/zhangdeman/serialize" "git.zhangdeman.cn/zhangdeman/serialize"
"github.com/axgle/mahonia" "github.com/axgle/mahonia"
"github.com/spaolacci/murmur3"
"io" "io"
"math/rand" "math/rand"
"strings" "strings"
@ -1175,3 +1176,15 @@ func (str String) HasSubStr(subStrList []string) bool {
} }
return false return false
} }
// HashNumber ...
//
// Author : go_developer@163.com<白茶清欢>
//
// Date : 11:05 2024/6/27
func (str String) HashNumber() Uint64Result {
return Uint64Result{
Value: murmur3.Sum64([]byte(str.Value())),
Err: nil,
}
}