将字符串转换为md5 [英] Convert a string to md5
本文介绍了将字符串转换为md5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我想像这样将字符串转换为md5
Hey all
I want to convert a string to md5 like this
1234567890123475e8dd316726b0335 = 8f 43 ae 1a 33 19 c6 49 cc 57 40 8b 6a 39 2d 6b
在此先感谢
请帮助我
Thanks in advance
Please Help me
推荐答案
MSDN示例:
http://msdn.microsoft.com/en-us/library/system. security.cryptography.md5.aspx [ ^ ]
第三方博客的示例:
http://warren5236.wordpress.com/2007/12/26 /calculating-an-md5-hash-in-vbnet/ [
MSDN example:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5.aspx[^]
Example from 3rd party blog:
http://warren5236.wordpress.com/2007/12/26/calculating-an-md5-hash-in-vbnet/[^]
MD5较弱且易于破解.如果数据安全是一个真正的问题,您可能需要重新考虑使用它.
MD5 is known to be weak and easily cracked. You may want to reconsider using it if security of data is a real issue.
这就是我曾经使用和工作的
试试吧
This is what i used and worked
try it
Dim md5 As MD5 = System.Security.Cryptography.MD5.Create()
Dim inputBytes As Byte() = System.Text.Encoding.ASCII.GetBytes("1234567890123475e8dd316726b0335")
Dim hash As Byte() = md5.ComputeHash(inputBytes)
Dim sb As New StringBuilder()
For i As Integer = 0 To hash.Length - 1
sb.Append(hash(i).ToString("x2"))
Next
TextBox1.Text = sb.ToString
希望我能帮上忙
Hope i helped
这篇关于将字符串转换为md5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文