mono项目开发模板,内置cli管理构建
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

439 B

crypto-wasm

JavaScript / TypeScript 调用

import { encrypt, decrypt } from '@dm/crypto-wasm';

function main() {
  const cipher = encrypt('hello world');
  const plain = decrypt(cipher);

  console.log(cipher); // Base64
  console.log(plain);  // hello world
}

main();

3) API

  • encrypt(data: string): string:返回 Base64 密文
  • decrypt(data: string): string:返回明文字符串