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

posted @ 2019-04-30 18:47  暴风雨之夜  阅读(2001)  评论(0编辑  收藏  举报