UNPKG

@hopeio/utils

Version:
33 lines (32 loc) 902 B
import { c as b, d as h, e as C } from "./compatible-D7WEyggZ.js"; import p from "crypto"; function d(c, t, r) { const e = p.createDecipheriv("aes-128-cbc", t, r); return e.update(c, "base64", "utf8") + e.final("utf8"); } function i(c, t, r) { const e = p.createCipheriv("aes-128-cbc", t, r); return e.update(c, "utf8", "base64") + e.final("base64"); } function s(c, t, r) { const e = p.createDecipheriv("aes-256-cbc", t, r); return e.update(c, "base64", "utf8") + e.final("utf8"); } function u(c, t, r) { const e = p.createCipheriv("aes-256-cbc", t, r); return e.update(c, "utf8", "base64") + e.final("base64"); } function o(c) { const t = p.createHash("md5"); return t.update(c), t.digest("hex"); } export { d as AES128CBCDecrypt, i as AES128CBCEncrypt, s as AES256CBCDecrypt, u as AES256CBCEncrypt, b as compatiblecrypto, h as decrypt, C as encrypt, o as mad5 };