Hi,
I’m trying to get the same results in javascript as in php.
The Original php encode is
base64_encode(hash(‘sha256’,iconv(“ISO-8859-1”, “UTF-16LE”,”hello”),true));
This works fine and matches the same result in C++ my friend wrote.
Now putting this into javascript.
The base64 encode works fine.
The sha256 hash works fine.
but when i try to use Base64 encode with the Unicode conversion my results are different to that in php
var code=”hello”;
for (i=0;i<5;i++)
{
current=current+(code.charCodeAt(i))
}
base64_encode(current)
This is the method i’m trying although I feel that it’s just making a string, and coverting that to base64 rather than the unicode,
Any suggestions?