import { JSEncrypt } from 'jsencrypt'
import Base64 from './base64'

var base64 = new Base64();
var encryptor = new JSEncrypt();
encryptor.setPublicKey('MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfm68MAkMmCfXPmPz/SSwaOrEQo7lxDKTtm21zgTRoKY5+NTeog9rpUUbpEfKaOxRy7KwF/geOfcR0AWSBJHQkt69d+SuUORIty0pchIjUNGclbxj+LCUlZwyCIuGjBk5CklBdi4NRobHgx2sK4Vkn9oZVsBaQ0yLQ+9OJFva5iQIDAQAB');

export function RsaParams(data) {
    return encodeURIComponent(encryptor.encrypt(base64.encode(data)))
}
