protected UserImpl() {}
public void register(String username, String password) throws UserAlreadyExistentException {
User other = this.userRepository.getUserByUsername(username);
if (other != null) {
throw new UserAlreadyExistentException("Already existent user with username: " + username);
} else {
try {
MessageDigest digest = MessageDigest.getInstance(DIGEST_ALGO);
digest.update(password.getBytes(DIGEST_CHARSET));
this.password = digest.digest();