Class BCrypt

java.lang.Object
com.helixframework.crypto.bcrypt.BCrypt

public final class BCrypt extends Object
Provides BCrypt hashing functionality for passwords and verification of hashed values.
  • Method Details

    • builder

      public static BCrypt.Builder builder()
      Creates a new builder instance for configuring a BCrypt hasher.
      Returns:
      a new Builder instance
    • newDefault

      public static BCrypt newDefault()
      Creates a new BCrypt instance with default configuration.
      Returns:
      a new BCrypt instance with default settings
    • hash

      public String hash(String rawValue)
      Generates a bcrypt hash of the supplied string.
      Parameters:
      rawValue - string to hash
      Returns:
      the hashed value of the supplied string
    • isMatch

      public boolean isMatch(String rawValue, String hashValue)
      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 hash
      hashValue - hashed value to match
      Returns:
      true if the values match; otherwise false