In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article introduces the method of SHA1 hash operation on strings in Go language. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
The code is as follows:
Package mainimport ("fmt", "crypto/md5", "crypto/sha1", "io") / / A pair of strings MD5 hash func a (data string) string {t: = md5.New (); io.WriteString (tdepartment data); return fmt.Sprintf ("% x", t.Sum (nil));} / / a pair of strings SHA1 hash func b (data string) string {t: = sha1.New (); io.WriteString (tForce data) Return fmt.Sprintf ("% x", t.Sum (nil));} func main () {var data string = "abc"; fmt.Printf ("MD5:% s\ n", a (data)); fmt.Printf ("SHA1:% s\ n", b (data));}
The output is as follows:
The copy code is as follows:
D:\ workspace\ golang > GetMd5AndSha1.exeMD5: 900150983cd24fb0d6963f7d28e17f72SHA1: a9993e364706816aba3e25717850c26c9cd0d89d on how the Go language SHA1 hashing strings is shared here, I hope the above content can be helpful to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.