|
@@ -47,6 +47,15 @@
|
|
|
})(USE, './https');
|
|
|
|
|
|
;USE(function(module){
|
|
|
+ if(typeof global !== "undefined"){
|
|
|
+ var g = global;
|
|
|
+ g.btoa = function (data) { return Buffer.from(data, "binary").toString("base64"); };
|
|
|
+ g.atob = function (data) { return Buffer.from(data, "base64").toString("binary"); };
|
|
|
+ }
|
|
|
+ })(USE, './base64');
|
|
|
+
|
|
|
+ ;USE(function(module){
|
|
|
+ USE('./base64');
|
|
|
|
|
|
function SeaArray() {}
|
|
|
Object.assign(SeaArray, { from: Array.from })
|
|
@@ -72,6 +81,7 @@
|
|
|
})(USE, './array');
|
|
|
|
|
|
;USE(function(module){
|
|
|
+ USE('./base64');
|
|
|
|
|
|
|
|
|
|
|
@@ -174,7 +184,7 @@
|
|
|
random: (len) => Buffer.from(crypto.randomBytes(len))
|
|
|
});
|
|
|
|
|
|
- const WebCrypto = USE('node-webcrypto-ossl', 1);
|
|
|
+ const { Crypto: WebCrypto } = USE('@peculiar/webcrypto', 1);
|
|
|
api.ossl = api.subtle = new WebCrypto({directory: 'ossl'}).subtle
|
|
|
|
|
|
|