Class BCryptHash.Builder
java.lang.Object
cloud.opencode.base.crypto.password.BCryptHash.Builder
- Enclosing class:
BCryptHash
Builder for creating customized BCrypt hashers
用于创建自定义 BCrypt 哈希器的构建器
- Since:
- JDK 25, opencode-base-crypto V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the BCryptHash instance 构建 BCryptHash 实例cost(int cost) Set the cost factor (number of iterations = 2^cost) 设置成本因子(迭代次数 = 2^成本)secureRandom(SecureRandom secureRandom) Set the SecureRandom instance for salt generation 设置用于盐值生成的 SecureRandom 实例
-
Method Details
-
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
Set the SecureRandom instance for salt generation 设置用于盐值生成的 SecureRandom 实例- Parameters:
secureRandom- the SecureRandom instance- Returns:
- this builder
-
build
Build the BCryptHash instance 构建 BCryptHash 实例- Returns:
- configured BCryptHash instance
-