A
Andrew Jocelyn
Hi
I'm trying the write code with Strict turned on. I Need to choose a type for
the cryptPassword variable but can't work out what it should be or how I
should convert it. I thought it should be a byte but the ComputeHash is a
Byte array. Can someone tell me what this should be? The code comes from
Wrox ASP.NET Website Programming Prob-Design-Solution book. Some good hints
on how to solve these sorts of problems would be excelent if anyone has any.
Public Shared Function EncryptPassword(ByVal password As String) As Byte()
Dim encoding As New UnicodeEncoding
Dim hashBytes As Byte() = encoding.GetBytes(password)
' Compute the SHA-1 hash
Dim sha1 As New SHA1CryptoServiceProvider
Dim cryptPassword = sha1.ComputeHash(hashBytes)
Return cryptPassword
End Function
Thanks
Andrew
I'm trying the write code with Strict turned on. I Need to choose a type for
the cryptPassword variable but can't work out what it should be or how I
should convert it. I thought it should be a byte but the ComputeHash is a
Byte array. Can someone tell me what this should be? The code comes from
Wrox ASP.NET Website Programming Prob-Design-Solution book. Some good hints
on how to solve these sorts of problems would be excelent if anyone has any.
Public Shared Function EncryptPassword(ByVal password As String) As Byte()
Dim encoding As New UnicodeEncoding
Dim hashBytes As Byte() = encoding.GetBytes(password)
' Compute the SHA-1 hash
Dim sha1 As New SHA1CryptoServiceProvider
Dim cryptPassword = sha1.ComputeHash(hashBytes)
Return cryptPassword
End Function
Thanks
Andrew