CryptoJS导入sha加密包出现错误


1 Uncaught TypeError: Cannot read property 'extend' of undefined
2     at sha224.js:12
3     at sha224.js:60
7 Uncaught TypeError: CryptoJS.SHA224 is not a function
8     at sha_crypto.html:53

在导入sha224.js的时候要注意:在到sha224之前一定要导入core.js和sha256.js的包,所有的包都依赖与core包,core包是核心包,在导入核心包的依赖后,sha224.js也依赖于sha256.js在没导入sha256.js包之前,会出现上述错误。包sha256.js导入就不会出错了。

 

1 sha384.js:13 Uncaught TypeError: Cannot read property 'extend' of undefined
2     at sha384.js:13
3     at sha384.js:63
4 sha_crypto.html:56 Uncaught TypeError: CryptoJS.SHA384 is not a function
5     at sha_crypto.html:56

在导入sha384.js的时候要注意:在导入sha384之前一定要导入sha512.js和x64-core.js,应为sha384.js依赖于sha512.js和x64-core.js。而且sha512.js也依赖于x64-core.js,不然会报

“ Uncaught TypeError: Cannot read property 'Word' of undefined ”的错误。

hmac.js依赖于core.js和其对应的算法,如要使用HmacMD5对应导入MD5.JS和hmac.js和core.js


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM