Guest User

Untitled

a guest
Dec 3rd, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. String username = editTextUsername.getText().toString();
  2. String password = editTextPassword.getText().toString();
  3. String hashedPW = BCrypt.hashpw(password, BCrypt.gensalt());
  4. User user = new User(username, hashedPW);
  5. user.save();
  6.  
  7. String username = editTextUsername.getText().toString();
  8. String enteredPassword = editTextPassword.getText().toString();
  9.  
  10. String hashedPW = BCrypt.hashpw(enteredPassword, BCrypt.gensalt());
  11.  
  12. User u = usercontroller.getUser(username); //gets user object
  13. String password = u.getPassword;
  14.  
  15. BCrypt.checkpw(password, hashedPW); //always returns false
  16.  
  17. BCrypt.checkpw(password, hashedPW);
  18.  
  19. BCrypt.checkpw(enteredPassword, password);
Add Comment
Please, Sign In to add comment