jeudi 1 avril 2021

How to get equivalent from Java script for SHA1

I am trying to get the equivalent output from java script for SHA1. My java code is given below.

String password = "nuwanw321nuwanw";
MessageDigest md = MessageDigest.getInstance("SHA-1");
md.update(password.getBytes());
System.out.println(( new BASE64Encoder() ).encode( md.digest() ));

It produce output as :- akIlJ5aXznl4f6mmGThlhkRn5UY= What is the correct way to get the same from java script.

Thanks




Aucun commentaire:

Enregistrer un commentaire