Page 1 of 1

.NET to PHP Hash

Posted: Thu May 01, 2008 10:18 am
by radicalfix
Can anyone help me with this

Public Shared Function ComputeHash(ByVal Key As String) As String
Dim objSHA1 As New SHA1CryptoServiceProvider()
objSHA1.ComputeHash(System.Text.Encoding.UTF8.GetBytes(Key.ToCharArray))
Dim buffer() As Byte = objSHA1.Hash
Dim HashValue As String = System.Convert.ToBase64String(buffer)
Return HashValue
End Function

I want to convert the above .NET to PHP. Thanks

Re: .NET to PHP Hash

Posted: Thu May 01, 2008 10:39 am
by onion2k

Code: Select all

sha1($string);