diff --git a/sea.js b/sea.js index cb702dc2..4c7a187f 100644 --- a/sea.js +++ b/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({ diff --git a/sea/work.js b/sea/work.js index 240003f4..cbe48bf6 100644 --- a/sea/work.js +++ b/sea/work.js @@ -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({