mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
improve sea.work
This commit is contained in:
parent
dfb0fb3fca
commit
f1bcb612a9
@ -16,8 +16,9 @@
|
||||
// Check if data is an ArrayBuffer, if so use Uint8Array to access the data
|
||||
if(data instanceof ArrayBuffer){
|
||||
data = new Uint8Array(data);
|
||||
data = new TextDecoder("utf-8").decode(data);
|
||||
}
|
||||
data = (typeof data == 'string')? data : await shim.stringify(data);
|
||||
data = (typeof data == 'string') ? data : await shim.stringify(data);
|
||||
if('sha' === (opt.name||'').toLowerCase().slice(0,3)){
|
||||
var rsha = shim.Buffer.from(await sha(data, opt.name), 'binary').toString(opt.encode || 'base64')
|
||||
if(cb){ try{ cb(rsha) }catch(e){console.log(e)} }
|
||||
|
Loading…
x
Reference in New Issue
Block a user