mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
fix: convert numeric salt to string in PBKDF2 implementation
This commit is contained in:
parent
38f7006d89
commit
b9a6b274f3
1
sea.js
1
sea.js
@ -297,6 +297,7 @@
|
||||
if(cb){ try{ cb(rsha) }catch(e){console.log(e)} }
|
||||
return rsha;
|
||||
}
|
||||
if (typeof salt === "number") salt = salt.toString();
|
||||
salt = salt || shim.random(9);
|
||||
var key = await (shim.ossl || shim.subtle).importKey('raw', new shim.TextEncoder().encode(data), {name: opt.name || 'PBKDF2'}, false, ['deriveBits']);
|
||||
var work = await (shim.ossl || shim.subtle).deriveBits({
|
||||
|
@ -23,6 +23,7 @@
|
||||
if(cb){ try{ cb(rsha) }catch(e){console.log(e)} }
|
||||
return rsha;
|
||||
}
|
||||
if (typeof salt === "number") salt = salt.toString();
|
||||
salt = salt || shim.random(9);
|
||||
var key = await (shim.ossl || shim.subtle).importKey('raw', new shim.TextEncoder().encode(data), {name: opt.name || 'PBKDF2'}, false, ['deriveBits']);
|
||||
var work = await (shim.ossl || shim.subtle).deriveBits({
|
||||
|
Loading…
x
Reference in New Issue
Block a user