I am trying to find a md5-js library which will return raw hash output equivalent of PHP's md5 function. What I'm trying to do here is:
In PHP:
echo base64_encode(md5('city', true)); // returns TtXS6u0aH63MQa0dWO1gPg==
// here setting the second parameter as true means md5 will return the raw out which is something like N������A�X�`>
In javascript I am using two npm packages. One for md5 and another for Base64 encoding. Below are the libraries:
The JS code line is below:
console.log('city: ', Base64.encode(md5('city', null, true))) // returns TsOVw5LDqsOtGh/CrcOMQcKtHVjDrWA+
Why both results are not identical? I'm trying to find a solution in Javascript which will return the same result as php.