Class BCryptHash.Builder

java.lang.Object
cloud.opencode.base.crypto.password.BCryptHash.Builder
Enclosing class:
BCryptHash

public static final class BCryptHash.Builder extends Object
Builder for creating customized BCrypt hashers 用于创建自定义 BCrypt 哈希器的构建器
Since:
JDK 25, opencode-base-crypto V1.0.0
Author:
Leon Soo www.LeonSoo.com
  • Method Details

    • cost

      public BCryptHash.Builder cost(int cost)
      Set the cost factor (number of iterations = 2^cost) 设置成本因子(迭代次数 = 2^成本)
      Parameters:
      cost - the cost factor (4-31, recommended 12-14)
      Returns:
      this builder
    • secureRandom

      public BCryptHash.Builder secureRandom(SecureRandom secureRandom)
      Set the SecureRandom instance for salt generation 设置用于盐值生成的 SecureRandom 实例
      Parameters:
      secureRandom - the SecureRandom instance
      Returns:
      this builder
    • build

      public BCryptHash build()
      Build the BCryptHash instance 构建 BCryptHash 实例
      Returns:
      configured BCryptHash instance