mirror of
https://github.com/amark/gun.git
synced 2025-06-06 14:16:44 +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
|
||||
}
|
||||
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;
|
||||
}}
|
||||
|
||||
|
14
sea/shim.js
14
sea/shim.js
@ -17,16 +17,20 @@
|
||||
api.TextDecoder = TextDecoder;
|
||||
api.TextEncoder = TextEncoder;
|
||||
}
|
||||
if(!api.crypto){try{
|
||||
if(!api.crypto)
|
||||
{
|
||||
try
|
||||
{
|
||||
var crypto = require('crypto', 1);
|
||||
Object.assign(api, {
|
||||
crypto,
|
||||
random: (len) => Buffer.from(crypto.randomBytes(len))
|
||||
});
|
||||
const isocrypto = require('isomorphic-webcrypto');
|
||||
api.ossl = api.subtle = isocrypto.subtle;
|
||||
}catch(e){
|
||||
console.log("text-encoding and isomorphic-webcrypto may not be included by default, please add it to your package.json!");
|
||||
const { Crypto: WebCrypto } = require('@peculiar/webcrypto', 1);
|
||||
api.ossl = api.subtle = new WebCrypto({directory: 'ossl'}).subtle // ECDH
|
||||
}
|
||||
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;
|
||||
}}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user