Single encryption/decryption in php and js

The fact is that one payment system accepts only Latin characters( And there is a need to pass a Russian word to my handler. Is there any function that encrypts and decrypts the same way both in php and in js. For example, if in js if there was a function for converting to a 64-decimal number system, as in php, then I would process the word when transmitting using js, and bring it back to normal in the php processor. does not match with php encryption for some reason.And then the question will be maybe someone has a function for converting to transliteration and vice versa?


Answer 1, authority 100%

I would use either base64or uuencode.


About base64– this encoding is reversible and unambiguous, which means that, most likely, there was an error somewhere in your code. As an alternative implementation on javascriptyou can try this one.

About uuencode– in phpthis is implemented using convert_uuencode, in javascriptthere is portof this very function.