From 9ff1c213bb504a685a6913123cf2a2e2bcc4006c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Thu, 27 Jun 2024 11:17:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A1=E7=AE=97=E5=AD=97=E7=AC=A6=E4=B8=B2ha?= =?UTF-8?q?sh=20nimber?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- string.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/string.go b/string.go index e82bd91..d59aa5c 100644 --- a/string.go +++ b/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, + } +}