Package com.helixframework.crypto.bcrypt
Class BCrypt
java.lang.Object
com.helixframework.crypto.bcrypt.BCrypt
Provides BCrypt hashing functionality for passwords and verification of hashed values.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic BCrypt.Builderbuilder()Creates a new builder instance for configuring a BCrypt hasher.Generates a bcrypt hash of the supplied string.booleanChecks to see if the supplied raw value hashes to the supplied hash value.static BCryptCreates a new BCrypt instance with default configuration.
-
Method Details
-
builder
Creates a new builder instance for configuring a BCrypt hasher.- Returns:
- a new Builder instance
-
newDefault
Creates a new BCrypt instance with default configuration.- Returns:
- a new BCrypt instance with default settings
-
hash
Generates a bcrypt hash of the supplied string.- Parameters:
rawValue- string to hash- Returns:
- the hashed value of the supplied string
-
isMatch
Checks to see if the supplied raw value hashes to the supplied hash value. If equal this means that the raw value is equal to the hash value (passwords match).- Parameters:
rawValue- string to hashhashValue- hashed value to match- Returns:
trueif the values match; otherwisefalse
-