Class Scrypt.Builder
java.lang.Object
cloud.opencode.base.crypto.kdf.Scrypt.Builder
- Enclosing class:
Scrypt
Builder for Scrypt configuration
Scrypt 配置构建器
- Since:
- JDK 25, opencode-base-crypto V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
-
Method Summary
Modifier and TypeMethodDescriptionblockSize(int r) Sets the block size parameter (r) 设置块大小参数(r)build()Builds the Scrypt instance 构建 Scrypt 实例parallelism(int p) Sets the parallelization parameter (p) 设置并行化参数(p)workFactor(int n) Sets the CPU/memory cost parameter (N) 设置 CPU/内存成本参数(N)
-
Method Details
-
workFactor
Sets the CPU/memory cost parameter (N) 设置 CPU/内存成本参数(N)- Parameters:
n- CPU/memory cost (must be power of 2, greater than 1)- Returns:
- this builder
-
blockSize
Sets the block size parameter (r) 设置块大小参数(r)- Parameters:
r- block size (must be positive)- Returns:
- this builder
-
parallelism
Sets the parallelization parameter (p) 设置并行化参数(p)- Parameters:
p- parallelization factor (must be positive)- Returns:
- this builder
-
build
Builds the Scrypt instance 构建 Scrypt 实例- Returns:
- new Scrypt instance
- Throws:
IllegalArgumentException- if parameters are invalid
-