Closed
Description
Summary
Since 5.2.0.RELEASE (388a7b6) BCrypt offers an overloaded hashpw method to hash a byte array. However there is no checkpw equivalent to check wether a byte array matches a previously hashed string.
If hashing a byte[], we are forced to wrap it into a String when calling the existing checkpw
and this does not necessarily returns the correct result:
byte[] pw = new byte[] { -5 };
assertThat(BCrypt.checkpw(new String(pw), BCrypt.hashpw(pw, BCrypt.gensalt()))).isTrue();