由于某种原因,我每次计算sha512散列并将其转换为字符串时,最后两个字符都是==。任何想法为什么?.NET - 计算SHA512与SHA512Managed - 为什么两个“==”转换为字符串时?
Function GetSHA512FromStringAsString(ByVal strdata As String)
Dim data As Byte() = StringToByte(strdata)
Dim result() As Byte
Dim shaM As New SHA512Managed()
result = shaM.ComputeHash(data)
Return ByteToString(result)
End Function
Function ByteToString(ByVal dBytes() As Byte)
Dim strText = Convert.ToBase64String(dBytes)
Return strText
End Function
谢谢!
中查到,但是哈希确实有64个字节,从0-63。 – 2012-07-20 18:50:54
@WFF_Angel和64模3是? ......确切地说:-) – fvu 2012-07-20 20:58:59