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.
|
|
23 hours ago | |
|---|---|---|
| .. | ||
| src | 23 hours ago | |
| Cargo.lock | 23 hours ago | |
| Cargo.toml | 23 hours ago | |
| README.md | 23 hours ago | |
| package.json | 23 hours ago | |
| vitest.config.ts | 23 hours ago | |
README.md
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:返回明文字符串