private void generatePlaintextSaltAndHash(UserPassword userPassword) { String random = stringGenerator.generateRandomAlphanumeric(); String plaintext = substring(random, plaintextBeginning, plaintextEnd); String salt = createSalt(random); String hash = getHash(plaintext, salt); populateUserPassword(userPassword, plaintext, salt, hash); }
@Override public void createUserPassword(String plaintext, UserPassword userPassword) { String random = stringGenerator.generateRandomAlphanumeric(); String salt = createSalt(random); String hash = getHash(plaintext, salt); populateUserPassword(userPassword, plaintext, salt, hash); }