update:SM2非对称加密的优化

This commit is contained in:
3030332422
2025-09-26 11:10:42 +08:00
parent 9b6acf1ffc
commit 9ec8ecf7f4
5 changed files with 8 additions and 42 deletions
-16
View File
@@ -256,19 +256,3 @@ export function sm2Decrypt(privateKey, cipherText) {
return sm2.doDecrypt(dataWithoutPrefix, privateKey, 1);
}
/**
* 判断字符串是否为Base64编码
* @param {string} str 待判断的字符串
* @returns {boolean} 是否为Base64编码
*/
export function isBase64(str) {
if (typeof str !== 'string' || str.trim() === '') {
return false;
}
try {
return btoa(atob(str)) === str;
} catch (e) {
return false;
}
}