简体   繁体   中英

HMAC SHA1 how to write in rhino- js

I want to implement HMAC SHA1 in rhino javascript(only in rhino js not in simple js). Can anybody please help me with some working code. Thank you in advance

Rhino is a JavaScript engine written fully in Java, it allows us to use Java libraries inside scripts:

importClass(java.security.MessageDigest);

var md = MessageDigest.getInstance("SHA-1");
var sha1 = md.digest((new java.lang.String("abc")).getBytes());

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM