/** * Check that the supplied mnemonic fits the BIP0039 spec. * <p> * The purpose of this method overload is to avoid constructing a mnemonic String if you have gathered a list of * words from the user. * * @param mnemonic The memorable list of words * @throws InvalidChecksumException If the last bytes don't match the expected last bytes * @throws InvalidWordCountException If the number of words is not a multiple of 3, 24 or fewer * @throws WordNotFoundException If a word in the mnemonic is not present in the word list * @throws UnexpectedWhiteSpaceException Occurs if one of the supplied words is empty */ public void validate(final Collection<? extends CharSequence> mnemonic) throws InvalidChecksumException, InvalidWordCountException, WordNotFoundException, UnexpectedWhiteSpaceException { final int[] wordIndexes = findWordIndexes(mnemonic); try { validate(wordIndexes); } finally { Arrays.fill(wordIndexes, 0); } }
/** * Check that the supplied mnemonic fits the BIP0039 spec. * <p> * The purpose of this method overload is to avoid constructing a mnemonic String if you have gathered a list of * words from the user. * * @param mnemonic The memorable list of words * @throws InvalidChecksumException If the last bytes don't match the expected last bytes * @throws InvalidWordCountException If the number of words is not a multiple of 3, 24 or fewer * @throws WordNotFoundException If a word in the mnemonic is not present in the word list * @throws UnexpectedWhiteSpaceException Occurs if one of the supplied words is empty */ public void validate(final Collection<? extends CharSequence> mnemonic) throws InvalidChecksumException, InvalidWordCountException, WordNotFoundException, UnexpectedWhiteSpaceException { final int[] wordIndexes = findWordIndexes(mnemonic); try { validate(wordIndexes); } finally { Arrays.fill(wordIndexes, 0); } }