好吧,我想从纯文本框中生成一个sha1哈希,然后将哈希转换为base64以存储在mysql数据库中,我该怎么做?
string s = "abc";
byte[] data = Encoding.Unicode.GetBytes(s);
SHA1 algorithm = SHA1.Create();
byte[] hash = algorithm.ComputeHash(data);
string base64 = Convert.ToBase64String(hash);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.