从hash加密开始之MD5
一杯浓咖啡
post on 2022-11-12 16:09:59
30
0
0
MD5加密golang代码及解释
func md5V1(str string) string {
//md5.New()初始化了一个md5对象
h := md5.New()
//h.Write将传入的str写入对象中
h.Write([]byte(str))
//h.Sum(nil)对对象中的内容进行校检和计算
return hex.EncodeToString(h.Sum(nil))
}
BitMere.com is Information release platform,just provides information storage space services.
The opinions expressed are solely those of the author,Does not constitute advice, please treat with caution.
The opinions expressed are solely those of the author,Does not constitute advice, please treat with caution.
Write the first review