// 加测试用例
it('assertHmacSHA1', 0, () => {
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
let c: string = CryptoJS.HmacSHA1("Message", "Key").toString();
let resc = 'c0334f18a5fbca1030ae7d7863ceca0206ce1712';
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
expect(c).assertEqual(resc);
})
```
```
{
"types": "index.d.ts",
"keywords": [
"crypto-js",
"OpenHarmony",
"HarmonyOS"
],
"author": "xxx",
"description": "JavaScript library of crypto standards.Nowadays, NodeJS and modern browsers have a native Crypto module. The latest version of CryptoJS already uses the native Crypto module for random number generation, since Math.random() is not crypto-safe. Further development of CryptoJS would result in it only being a wrapper of native Crypto. Therefore, development and maintenance has been discontinued, it is time to go for the native crypto module.",
"ohos": {
"org": "opensource"
},
"main": "index.ts",
"repository": "https://gitee.com/openharmony-sig/crypto-js",
"type": "module",
"version": "2.0.4-rc.1",
"dependencies": {},
"tags": [
"Tools",
"Security"
],
"license": "MIT",
"devDependencies": {},
"name": "@ohos/crypto-js"
}
```
### 总结