I have to convert this function from php to javascript:
<?php
$hashbytes = mb_convert_encoding($hashtr, "ISO-8859-9");
$hash = base64_encode ( sha1 ( $hashbytes, true ) );
And i tried this :
function sha1(data) {
return crypto.createHash("sha1").update(data, "binary").digest("hex");
}
hash = Buffer.from( sha1 ( hashtr, true )).toString('base64')
But when i compare that results they are not equals. Where i do mistake ?