.NET to PHP Hash

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
radicalfix
Forum Newbie
Posts: 7
Joined: Mon Dec 04, 2006 10:49 pm

.NET to PHP Hash

Post 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
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: .NET to PHP Hash

Post by onion2k »

Code: Select all

sha1($string);
Post Reply