Javascript equivalent for PHP md5 (), which will also work with multibyte strings?

EDIT: The script mentioned in the question and the other script mentioned in the answers both works fine with multibyte strings - it turns out that my problem was elsewhere.

Does anyone know of such an implementation? The script at http://phpjs.org/functions/view/469 works well, just not on multibyte strings.

+1


source to share


2 answers


This implementation seems to handle UTF-8 strings correctly. If you want to test the demo, make sure you change the page encoding to UTF-8 first in your browser settings.



+4


source


script you have str = utf8_encode(str);

.
You should probably remove this line and pass your Cyrillic as UTF-8.



+1


source







All Articles