@Test public void testVersionWithNullTerminator() { char[] pw = "myverlongpasswordthatisatleast72charslongandlongnothisisnotlongenoughyou".toCharArray(); assertEquals(72, pw.length); assertEquals(72, Bytes.from(pw).length()); byte[] salt = Bytes.random(16).array(); byte[] hash1 = BCrypt.with(BCrypt.Version.VERSION_2Y_NO_NULL_TERMINATOR, LongPasswordStrategies.truncate(BCrypt.Version.VERSION_2Y_NO_NULL_TERMINATOR)).hash(4, salt, Bytes.from(pw).array()); byte[] hash2 = BCrypt.with(BCrypt.Version.VERSION_2Y, LongPasswordStrategies.truncate(BCrypt.Version.VERSION_2Y)).hash(4, salt, Bytes.from(pw).array()); assertNotEquals(Bytes.wrap(hash1).encodeUtf8(), Bytes.wrap(hash2).encodeUtf8()); System.out.println(Bytes.wrap(hash1).encodeUtf8() + "\n" + Bytes.wrap(hash2).encodeUtf8()); }
public static Hasher with(Version version) { return new Hasher(version, new SecureRandom(), LongPasswordStrategies.strict(version)); }
BCrypt { public static Hasher with(Version version) { return new Hasher(version, new SecureRandom(), LongPasswordStrategies.strict(version)); } }
BCrypt { public static Hasher with(Version version) { return new Hasher(version, new SecureRandom(), LongPasswordStrategies.strict(version)); } private  BCrypt(); }
BCrypt { public static Hasher with(Version version) { return new Hasher(version, new SecureRandom(), LongPasswordStrategies.strict(version)); } private  BCrypt(); static Hasher withDefaults(); static Hasher with(Version version); static Hasher with(SecureRandom secureRandom); static Hasher with(LongPasswordStrategy longPasswordStrategy); static Hasher with(Version version, LongPasswordStrategy longPasswordStrategy); static Hasher with(Version version, SecureRandom secureRandom, LongPasswordStrategy longPasswordStrategy); static Verifyer verifyer(); static Verifyer verifyer(Version version); static Verifyer verifyer(Version version, LongPasswordStrategy longPasswordStrategy); }
BCrypt { public static Hasher with(Version version) { return new Hasher(version, new SecureRandom(), LongPasswordStrategies.strict(version)); } private  BCrypt(); static Hasher withDefaults(); static Hasher with(Version version); static Hasher with(SecureRandom secureRandom); static Hasher with(LongPasswordStrategy longPasswordStrategy); static Hasher with(Version version, LongPasswordStrategy longPasswordStrategy); static Hasher with(Version version, SecureRandom secureRandom, LongPasswordStrategy longPasswordStrategy); static Verifyer verifyer(); static Verifyer verifyer(Version version); static Verifyer verifyer(Version version, LongPasswordStrategy longPasswordStrategy); static final int SALT_LENGTH; static final int MIN_COST; static final int MAX_COST; }