mirror of
https://github.com/amark/gun.git
synced 2025-06-06 22:26:48 +00:00
fix: typo
This commit is contained in:
parent
72c699f20b
commit
5016298b45
2
sea.js
2
sea.js
@ -195,7 +195,7 @@
|
|||||||
api.ossl = api.subtle = new WebCrypto({directory: 'ossl'}).subtle // ECDH
|
api.ossl = api.subtle = new WebCrypto({directory: 'ossl'}).subtle // ECDH
|
||||||
}
|
}
|
||||||
catch(e){
|
catch(e){
|
||||||
console.log("text-encoding and isomorphic-webcrypto may not be included by default, please add it to your package.json!");
|
console.log("text-encoding and peculiar/nwebcrypto may not be included by default, please add it to your package.json!");
|
||||||
TEXT_ENCODING_OR_PECULIAR_WEBCRYPTO_NOT_INSTALLED;
|
TEXT_ENCODING_OR_PECULIAR_WEBCRYPTO_NOT_INSTALLED;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
14
sea/shim.js
14
sea/shim.js
@ -17,16 +17,20 @@
|
|||||||
api.TextDecoder = TextDecoder;
|
api.TextDecoder = TextDecoder;
|
||||||
api.TextEncoder = TextEncoder;
|
api.TextEncoder = TextEncoder;
|
||||||
}
|
}
|
||||||
if(!api.crypto){try{
|
if(!api.crypto)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
var crypto = require('crypto', 1);
|
var crypto = require('crypto', 1);
|
||||||
Object.assign(api, {
|
Object.assign(api, {
|
||||||
crypto,
|
crypto,
|
||||||
random: (len) => Buffer.from(crypto.randomBytes(len))
|
random: (len) => Buffer.from(crypto.randomBytes(len))
|
||||||
});
|
});
|
||||||
const isocrypto = require('isomorphic-webcrypto');
|
const { Crypto: WebCrypto } = require('@peculiar/webcrypto', 1);
|
||||||
api.ossl = api.subtle = isocrypto.subtle;
|
api.ossl = api.subtle = new WebCrypto({directory: 'ossl'}).subtle // ECDH
|
||||||
}catch(e){
|
}
|
||||||
console.log("text-encoding and isomorphic-webcrypto may not be included by default, please add it to your package.json!");
|
catch(e){
|
||||||
|
console.log("text-encoding and peculiar/nwebcrypto may not be included by default, please add it to your package.json!");
|
||||||
TEXT_ENCODING_OR_PECULIAR_WEBCRYPTO_NOT_INSTALLED;
|
TEXT_ENCODING_OR_PECULIAR_WEBCRYPTO_NOT_INSTALLED;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user