// 加测试用例
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);
})
```
// 生成 d.ts文件
wshi@ubuntu:~$ dts-gen -m crypto-js -f crypto-js.d.ts
Wrote 3412 lines to crypto-js.d.ts.
// 对应 d.ts文件内容
/** Declaration file generated by dts-gen */
export const algo: {
AES: {
$super: {
$super: {
$super: {
$super: {
clone: any;
create: any;
extend: any;
init: any;
mixIn: any;
。。。
```
* **导出package,配置项的设置请参考**[oh-package.json5配置说明](https://developer.huawei.com/con ... n5-0000001796357425):
```
{
"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"
}
```