public static boolean checkpw(String plaintext, String hashed) {
        return (hashed.compareTo(hashpw(plaintext, hashed)) == 0);
    }
public static boolean checkpw ( String plaintext , String hashed ) { return ( hashed . compareTo ( hashpw ( plaintext , hashed ) ) == 0 ) ; }
Check that a plaintext password matches a previously hashed
one
@param plaintext	the plaintext password to verify
@param hashed	the previously-hashed password
@return	true if the passwords match, false otherwise