From 1fcde5ff76546c321e73b233336382948f703314 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E8=8C=B6=E6=B8=85=E6=AC=A2?= Date: Fri, 21 Oct 2022 14:13:29 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=81=E5=B7=B1=E6=95=B0=E7=BB=84=E6=8E=A5?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E7=AD=BE=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- string.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/string.go b/string.go index b00a29c..fbca9f8 100644 --- a/string.go +++ b/string.go @@ -58,6 +58,17 @@ func (s *stringOperate) Md5(str string) string { return hex.EncodeToString(h.Sum(nil)) } +// Md5FromByte 从字节数组计算签名 +// +// Author : go_developer@163.com<白茶清欢> +// +// Date : 2022/10/21 14:12:16 +func (s *stringOperate) Md5FromByte(data []byte) string { + h := md5.New() + _, _ = h.Write(data) + return hex.EncodeToString(h.Sum(nil)) +} + // SnakeCaseToCamel 蛇形字符串转换为驼峰 // // Author : go_developer@163.com<白茶清欢>