@Test public void legacyCompatible() throws UnsupportedEncodingException { String test = "secret"; String hashedString = DigestUtils.md5Hex( test.getBytes( "UTF-8" ) ); byte[] hashedStringBytes = hashedString.getBytes( "UTF-8" ); Md5HashCommand command = new Md5HashCommand(); CredentialsInfo info = new CredentialsInfo(); byte[] results = command.hash( test.getBytes( "UTF-8" ), info, null, null ); assertArrayEquals( hashedStringBytes, results ); }
@Override public byte[] hash( byte[] input, CredentialsInfo info, UUID userId, UUID applicationId ) { byte[] data = maybeSalt( input, applicationId, userId ); return DigestUtils.md5Hex( data ).getBytes( UTF8 ); }
Md5HashCommand extends SaltedHasherCommand { @Override public byte[] hash( byte[] input, CredentialsInfo info, UUID userId, UUID applicationId ) { byte[] data = maybeSalt( input, applicationId, userId ); return DigestUtils.md5Hex( data ).getBytes( UTF8 ); } }
Md5HashCommand extends SaltedHasherCommand { @Override public byte[] hash( byte[] input, CredentialsInfo info, UUID userId, UUID applicationId ) { byte[] data = maybeSalt( input, applicationId, userId ); return DigestUtils.md5Hex( data ).getBytes( UTF8 ); }  }
Md5HashCommand extends SaltedHasherCommand { @Override public byte[] hash( byte[] input, CredentialsInfo info, UUID userId, UUID applicationId ) { byte[] data = maybeSalt( input, applicationId, userId ); return DigestUtils.md5Hex( data ).getBytes( UTF8 ); }  @Override byte[] hash( byte[] input, CredentialsInfo info, UUID userId, UUID applicationId ); @Override byte[] auth( byte[] input, CredentialsInfo info, UUID userId, UUID applicationId ); @Override String getName(); }
Md5HashCommand extends SaltedHasherCommand { @Override public byte[] hash( byte[] input, CredentialsInfo info, UUID userId, UUID applicationId ) { byte[] data = maybeSalt( input, applicationId, userId ); return DigestUtils.md5Hex( data ).getBytes( UTF8 ); }  @Override byte[] hash( byte[] input, CredentialsInfo info, UUID userId, UUID applicationId ); @Override byte[] auth( byte[] input, CredentialsInfo info, UUID userId, UUID applicationId ); @Override String getName();  }