I need to do this with php encryption method. turkey 3d a bank payment module in the code for the example given to me in this way encryption. could you help me translate this into php code?
SHA1 sha1 = new SHA1CryptoServiceProvider();
byte[] notHashedBytes = System.Text.Encoding.ASCII.GetBytes(notHashedStr);
byte[] hashedByte = sha1.ComputeHash(notHashedBytes);
string h开发者_开发问答ashedStr = System.Convert.ToBase64String(hashedByte);
return hashedStr;
I know nothing about .Net but from what I gathered in this page seems like the PHP equivalent is just:
$hashedStr = base64_encode(sha1($notHashedStr, true));
You need to encode the raw binary format and not the hexadecimal representation.
精彩评论