This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
const sm4 =require('sm-crypto').sm4
//const key='7f5cd501e5548914edaed6824d3ff79d'//可以为16进制串或字节数组,要求为128比特
/**
* 加密
* @param txt
* @returns {*}
*/
export function encrypt(txt,key) {
return sm4.encrypt(txt,key);
}
export function decrypt(txt,key) {
return sm4.decrypt(txt,key);