@sparta-utils/crypto-util
Version:
一个支持多种加密算法的加密工具库,涵盖 AES、RSA、SM2、SM3、SM4、SHA、HMAC、MD5、Base64、JWT 等,适用于日常加解密、签名验签、摘要、Token 管理等场景。
28 lines (27 loc) • 999 B
TypeScript
import * as AESUtil from './symmetric/aes';
import * as SM4Util from './symmetric/sm4';
import * as RSAUtil from './asymmetric/rsa';
import * as SM2Util from './asymmetric/sm2';
import * as SHAUtil from './hash/sha';
import * as HMACUtil from './hash/hmac';
import { sm3 } from './hash/sm3';
import { md5 } from './hash/md5';
import { encodeBase64, decodeBase64 } from './encode/base64';
import * as JWTUtil from './jwt/jwt';
import type { AesOptions, RsaKeyPair, Sm2KeyPair, SignatureResult } from './types';
export declare class CryptoUtil {
static aes: typeof AESUtil;
static rsa: typeof RSAUtil;
static sm2: typeof SM2Util;
static sm4: typeof SM4Util;
static sha: typeof SHAUtil;
static hmac: typeof HMACUtil;
static sm3: typeof sm3;
static md5: typeof md5;
static jwt: typeof JWTUtil;
static base64: {
encode: typeof encodeBase64;
decode: typeof decodeBase64;
};
}
export type { AesOptions, RsaKeyPair, Sm2KeyPair, SignatureResult };