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

Commit

Permalink
Fix random index calculation in hideRandomWord()
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Warta committed Apr 7, 2018
1 parent ab5aafe commit a851e9d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/passphrase/passphraseVerifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class PassphraseConfirmator extends React.Component {

hideRandomWord(rand = Math.random()) {
const words = this.props.passphrase.trim().split(/\s+/).filter(item => item.length > 0);
const index = Math.floor(rand * (words.length - 1));
const index = Math.floor(rand * words.length);

this.setState({
passphraseParts: this.props.passphrase.split(words[index]),
Expand Down

0 comments on commit a851e9d

Please sign in to comment.