import { JSEncrypt } from ‘jsencrypt‘
// RSA加密
export const HkSetEncrypt = (pubKey, value) => {
const encrypt = new JSEncrypt()
encrypt.setPublicKey(pubKey)
return encrypt.encrypt(value)
}
export function setEncrypt (str) {
const key = `MIGeMA0GCSqGSSFFKHIUNFBKHIWMADCBiAKBgH9RB1AJw1b5f1eE52+icZplN40I
eAooLdn9zb2tJCHmUQuFHaMAgUGTlrMYstjjy5MMvteZ3L0LmJd9g9Czyp2PQblk
WEATn3YA9G00DiEgWJZ5HIDUUWBKOSWDGcFHhD2gvp62OaJPTkRvYgjv
r+TvVdvVRo3DPT/rAgMBAAE=`
const jsencrypt = new JSEncrypt()
jsencrypt.setPublicKey(key)
return jsencrypt.encrypt(str)
}