Class SCryptHash.Builder
java.lang.Object
cloud.opencode.base.crypto.password.SCryptHash.Builder
- Enclosing class:
SCryptHash
Builder for creating custom SCryptHash instances
用于创建自定义 SCryptHash 实例的构建器
- Since:
- JDK 25, opencode-base-crypto V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionblockSize(int r) Set block size parameter (r) 设置块大小参数(r)build()Build the SCryptHash instance 构建 SCryptHash 实例keyLength(int length) Set key output length in bytes 设置密钥输出长度(字节)parallelism(int p) Set parallelization parameter (p) 设置并行化参数(p)secureRandom(SecureRandom secureRandom) Set custom SecureRandom instance 设置自定义 SecureRandom 实例workFactor(int n) Set CPU/memory cost parameter (N) 设置 CPU/内存成本参数(N)
-
Method Details
-
workFactor
Set CPU/memory cost parameter (N) 设置 CPU/内存成本参数(N)- Parameters:
n- work factor (must be power of 2, minimum 2)- Returns:
- this builder
-
blockSize
Set block size parameter (r) 设置块大小参数(r)- Parameters:
r- block size (minimum 1)- Returns:
- this builder
-
parallelism
Set parallelization parameter (p) 设置并行化参数(p)- Parameters:
p- parallelism (minimum 1)- Returns:
- this builder
-
keyLength
Set key output length in bytes 设置密钥输出长度(字节)- Parameters:
length- key length in bytes (minimum 16)- Returns:
- this builder
-
secureRandom
Set custom SecureRandom instance 设置自定义 SecureRandom 实例- Parameters:
secureRandom- the SecureRandom instance- Returns:
- this builder
-
build
Build the SCryptHash instance 构建 SCryptHash 实例- Returns:
- new SCryptHash instance
-