计算字符串hash nimber
This commit is contained in:
parent
8d056baada
commit
9ff1c213bb
13
string.go
13
string.go
@ -13,6 +13,7 @@ import (
|
||||
"errors"
|
||||
"git.zhangdeman.cn/zhangdeman/serialize"
|
||||
"github.com/axgle/mahonia"
|
||||
"github.com/spaolacci/murmur3"
|
||||
"io"
|
||||
"math/rand"
|
||||
"strings"
|
||||
@ -1175,3 +1176,15 @@ func (str String) HasSubStr(subStrList []string) bool {
|
||||
}
|
||||
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,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user