mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Brought back new changes
This commit is contained in:
parent
7d7b11f9b8
commit
cf642b75d1
9
sea.js
9
sea.js
@ -17,6 +17,13 @@
|
||||
}
|
||||
if(typeof module !== "undefined"){ var common = module }
|
||||
/* UNBUILD */
|
||||
function atob(a) {
|
||||
return new Buffer(a, 'base64').toString('binary');
|
||||
};
|
||||
|
||||
function btoa(b) {
|
||||
return new Buffer(b).toString('base64');
|
||||
};
|
||||
|
||||
;USE(function(module){
|
||||
// Security, Encryption, and Authorization: SEA.js
|
||||
@ -174,7 +181,7 @@
|
||||
random: (len) => Buffer.from(crypto.randomBytes(len))
|
||||
});
|
||||
//try{
|
||||
const WebCrypto = USE('node-webcrypto-ossl', 1);
|
||||
const { Crypto: WebCrypto } = USE('@peculiar/webcrypto', 1);
|
||||
api.ossl = api.subtle = new WebCrypto({directory: 'ossl'}).subtle // ECDH
|
||||
//}catch(e){
|
||||
//console.log("node-webcrypto-ossl is optionally needed for ECDH, please install if needed.");
|
||||
|
@ -1,4 +1,6 @@
|
||||
|
||||
function btoa(b) {
|
||||
return new Buffer(b).toString('base64');
|
||||
};
|
||||
// This is Array extended to have .toString(['utf8'|'hex'|'base64'])
|
||||
function SeaArray() {}
|
||||
Object.assign(SeaArray, { from: Array.from })
|
||||
|
@ -1,4 +1,6 @@
|
||||
|
||||
function atob(a) {
|
||||
return new Buffer(a, 'base64').toString('binary');
|
||||
};
|
||||
// This is Buffer implementation used in SEA. Functionality is mostly
|
||||
// compatible with NodeJS 'safe-buffer' and is used for encoding conversions
|
||||
// between binary and 'hex' | 'utf8' | 'base64'
|
||||
|
@ -22,7 +22,7 @@
|
||||
random: (len) => Buffer.from(crypto.randomBytes(len))
|
||||
});
|
||||
//try{
|
||||
const WebCrypto = require('node-webcrypto-ossl', 1);
|
||||
const { Crypto: WebCrypto } = USE('@peculiar/webcrypto', 1);
|
||||
api.ossl = api.subtle = new WebCrypto({directory: 'ossl'}).subtle // ECDH
|
||||
//}catch(e){
|
||||
//console.log("node-webcrypto-ossl is optionally needed for ECDH, please install if needed.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user