@Test public void testIsHashed() { assertTrue(PasswordHelper.isHashed("{SSHA}foo")); assertTrue(PasswordHelper.isHashed("{SMD5}foo")); assertFalse(PasswordHelper.isHashed("{foo}bar")); assertFalse(PasswordHelper.isHashed("foo")); }
public static boolean isHashed(String password) { return password.startsWith(HSSHA) || password.startsWith(HSMD5); }
PasswordHelper { public static boolean isHashed(String password) { return password.startsWith(HSSHA) || password.startsWith(HSMD5); } }
PasswordHelper { public static boolean isHashed(String password) { return password.startsWith(HSSHA) || password.startsWith(HSMD5); } private  PasswordHelper(); }
PasswordHelper { public static boolean isHashed(String password) { return password.startsWith(HSSHA) || password.startsWith(HSMD5); } private  PasswordHelper(); static boolean isHashed(String password); static String hashPassword(String password, String algorithm); static boolean verifyPassword(String password, String hashedPassword); static byte[] digestWithSalt(String password, byte[] salt, String algorithm); }
PasswordHelper { public static boolean isHashed(String password) { return password.startsWith(HSSHA) || password.startsWith(HSMD5); } private  PasswordHelper(); static boolean isHashed(String password); static String hashPassword(String password, String algorithm); static boolean verifyPassword(String password, String hashedPassword); static byte[] digestWithSalt(String password, byte[] salt, String algorithm); static final String SSHA; static final String SMD5; }