I am using the Java implementation of BCrypt and I want to test if a string has already been hashed with BCrypt. Is it possible to to that ?
I couldn't find anything. It would work like this
if (!BCrypt.hasBeenHashed(myString)) {
return BCrypt.hashpw(myString, salt);
}
// BCrypt.hasBeenHashed("my-new-password") > FALSE
// BCrypt.hasBeenHashed("$fdshjkfhdsfhdjkshfjdhfjd") > TRUE
The idea is that I have an automatic method that hashes some strings at creation. When I update the object, I want it to hash only the "new values".
Thanks.