Tuesday, May 21, 2024
 Popular · Latest · Hot · Upcoming
95
rated 0 times [  97] [ 2]  / answers: 1 / hits: 25244  / 7 Years ago, tue, july 4, 2017, 12:00:00

I have written javascript to for RSASHA256 but gettitng error crypto.js is not defined.



 function aaa(message,secret) {
<script src=http://crypto-
js.googlecode.com/svn/tags/3.0.2/build/rollups/hmac-sha256.js></script>;
<script src=http://crypto-
js.googlecode.com/svn/tags/3.0.2/build/components/enc-base64-min.js></script>;
var hash = CryptoJS.HmacSHA256(Message, secret);
var hashInBase64 = CryptoJS.enc.Base64.stringify(hash);
document.write(hashInBase64);
}

More From » sha

 Answers
28

You need to set the <script> tags inside your HTML.





 function aaa(message,secret) {
var hash = CryptoJS.HmacSHA256(Message, secret);
var hashInBase64 = CryptoJS.enc.Base64.stringify(hash);
document.write(hashInBase64);
}

   <script src=https://cdnjs.cloudflare.com/ajax/libs/crypto-js/3.1.9-1/crypto-js.js>




[#57216] Friday, June 30, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jaredsages

Total Points: 273
Total Questions: 97
Total Answers: 105

Location: French Southern and Antarctic Lands
Member since Fri, Jan 6, 2023
1 Year ago
jaredsages questions
;