Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Merge pull request #785 from LiskHQ/725-passphrase-e2e-tests
Browse files Browse the repository at this point in the history
Stabilise Passphrase e2e tests - Closes #725
  • Loading branch information
reyraa authored Sep 28, 2017
2 parents 629c06e + 96bd491 commit a12efc6
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/utils/passphrase.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,16 @@ const leftPadd = (str, pad, length) => {
/**
* Resets previous settings and creates a step with a random length between 1.6% to 3.2%
*/
const init = (rand = Math.random()) => ({
step: (160 + Math.floor(rand * 160)) / 100,
percentage: 0,
seed: emptyByte('00'),
byte: emptyByte(0),
});
const init = (rand = Math.random()) => {
let step = Math.max((160 + Math.floor(rand * 160)));
step = step >= 0.01 ? step : step * 10;
return {
step,
percentage: 0,
seed: emptyByte('00'),
byte: emptyByte(0),
};
};

/**
* - From a zero byte:
Expand Down

0 comments on commit a12efc6

Please sign in to comment.