UNPKG

@alauda/doom

Version:

Doctor Doom making docs.

8 lines (7 loc) 317 B
import { JSEncrypt } from 'jsencrypt'; export const crypto = (pubkey, encryptString) => { const encrypt = new JSEncrypt(); encrypt.setPublicKey(pubkey); return encrypt.encrypt(encryptString); }; export const cryptoPassword = ({ pubkey, ts }, password) => crypto(pubkey, JSON.stringify({ ts, password }));