|
5精币
请问一下怎么改才能不报错,成功运行
var t = {
var Wi = function(t) {
t = t || {},
this.default_key_size = parseInt(t.default_key_size) || 1024,
this.default_public_exponent = t.default_public_exponent || "010001",
this.log = t.log || !1,
this.key = null
};
return Wi.prototype.setKey = function(t) {
this.log && this.key && console.warn("A key was already set, overriding existing."),
this.key = new Gi(t)
},
Wi.prototype.setPrivateKey = function(t) {
this.setKey(t)
},
Wi.prototype.setPublicKey = function(t) {
this.setKey(t)
},
Wi.prototype.decrypt = function(t) {
try {
return this.getKey().decrypt(xi(t))
} catch(e) {
return ! 1
}
},
Wi.prototype.encrypt = function(t) {
try {
return wi(this.getKey().encrypt(t))
} catch(e) {
return ! 1
}
},
Wi.prototype.alipayEncrypt = function(t, e, i) {
try {
return wi(this.getKey().alipayEncrypt(t, e, i))
} catch(n) {
return ! 1
}
},
Wi.prototype.getKey = function(t) {
if (!this.key) {
if (this.key = new Gi, t && "[object Function]" === {}.toString.call(t)) return void this.key.generateAsync(this.default_key_size, this.default_public_exponent, t);
this.key.generate(this.default_key_size, this.default_public_exponent)
}
return this.key
},
Wi.prototype.getPrivateKey = function() {
return this.getKey().getPrivateKey()
},
Wi.prototype.getPrivateKeyB64 = function() {
return this.getKey().getPrivateBaseKeyB64()
},
Wi.prototype.getPublicKey = function() {
return this.getKey().getPublicKey()
},
Wi.prototype.getPublicKeyB64 = function() {
return this.getKey().getPublicBaseKeyB64()
},
t = Wi
} (),
t.setKey()
补充内容 (2020-2-29 17:10):
请问一下怎么改才能不报错,成功运行 |
-
最佳答案
查看完整内容
你这个不是完整的js要么你放网址,也许还可以改
|