S
S
Svyatoslav Nemato2016-08-29 16:42:41
PHP
Svyatoslav Nemato, 2016-08-29 16:42:41

How to generate same md5 in php and jquery for russian test?

If you can give an example and a link to the plugin, otherwise all these plugins work well with English text, but if you write a Russian word, the jquery and php hashes immediately differ.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladimir Martyanov, 2016-08-29
@vilgeforce

Because encoding. Bring the data to the same bytes, I think that's enough.

D
Dmitry Belyaev, 2016-08-29
@bingo347

Most crypto libs on js take the bytes of a string using String.prototype.charCodeAt () which returns the character code in utf16-LE encoding (native encoding for strings in js)
As far as I remember, md5 in php works with single-byte encodings and uses the one that is written in php.ini
Here is the difference

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question