For most APIs provided by the third-party library @ohos/crypto-js, if the SDK has the corresponding built-in system implementation (@ohos.security.cryptoFramework), you are advised to use the built-in system APIs.
// code-linter.json5
{
"rules": {
"@performance/crypto-replacement-check": "warn",
}
} import cryptoFramework from '@ohos.security.cryptoFramework';
// MD5 encryption
let md = cryptoFramework.createMd('MD5'); import { CryptoJS } from '@ohos/crypto-js';
/**
* Library installation: ohpm install @ohos/crypto-js
*/
// MD5 encryption
let mdOutput = CryptoJS.MD5('Message'); plugin:@performance/recommended plugin:@performance/all
For details about how to configure Code Linter check rules, see Code Linter.