Vlang中md5签名使用分享

  V语言中文网  |   1725 |    2019-10-09 17:57:38


md5签名是开发中经常用到的,今天分享下vlang中使用如何使用md5签名函数。

示例代码:

import crypto.md5
fn main(){
  text:="hello world!"
  sign:=md5.sum(text.bytes()).hex()
  println(sign.to_upper()) //FC3FF98E8C6A0D3087D515C0473F8677
  println(sign.to_lower()) //fc3ff98e8c6a0d3087d515c0473f8677
}

登陆后可发表评论


热门评论

暂无评论


最新评论

暂无评论