allocate blockSeed as Uint8Array

This commit is contained in:
ansuz
2018-06-28 15:21:13 +02:00
parent 7aa7b82c60
commit cfc81e8c96
2 changed files with 4 additions and 1 deletions

View File

@@ -23,6 +23,9 @@ define([
// should be deterministic from a seed...
Block.genkeys = function (seed) {
if (!(seed instanceof Uint8Array)) {
throw new Error('INVALID_SEED_FORMAT');
}
if (!seed || typeof(seed.length) !== 'number' || seed.length < 64) {
throw new Error('INVALID_SEED_LENGTH');
}