diff --git a/CHANGELOG.md b/CHANGELOG.md index df9bedd5f..4641bd49b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ * 【core 】 DatePattern增加年月格式化常量(pr#220@Gitee) * 【core 】 ArrayUtil增加shuffle方法(pr#1255@Github) * 【core 】 ArrayUtil部分方法分离至PrimitiveArrayUtil +* 【crypto 】 opt改为otp包(issue#1257@Github) ### Bug修复 * 【cron 】 修复CronTimer可能死循环的问题(issue#1224@Github) diff --git a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/opt/HOTP.java b/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/HOTP.java similarity index 95% rename from hutool-crypto/src/main/java/cn/hutool/crypto/digest/opt/HOTP.java rename to hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/HOTP.java index cc3598aa5..ba4b31623 100644 --- a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/opt/HOTP.java +++ b/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/HOTP.java @@ -1,4 +1,4 @@ -package cn.hutool.crypto.digest.opt; +package cn.hutool.crypto.digest.otp; import cn.hutool.crypto.digest.HMac; import cn.hutool.crypto.digest.HmacAlgorithm; diff --git a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/opt/TOPT.java b/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/TOTP.java similarity index 84% rename from hutool-crypto/src/main/java/cn/hutool/crypto/digest/opt/TOPT.java rename to hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/TOTP.java index 84ec7b5f5..b03214c76 100644 --- a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/opt/TOPT.java +++ b/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/TOTP.java @@ -1,4 +1,4 @@ -package cn.hutool.crypto.digest.opt; +package cn.hutool.crypto.digest.otp; import cn.hutool.crypto.digest.HmacAlgorithm; @@ -13,7 +13,7 @@ import java.time.Instant; * * @author Looly */ -public class TOPT extends HOTP { +public class TOTP extends HOTP { /** * 默认步进 (30秒). @@ -27,7 +27,7 @@ public class TOPT extends HOTP { * * @param key 共享密码,RFC 4226要求最少128位 */ - public TOPT(byte[] key) { + public TOTP(byte[] key) { this(DEFAULT_TIME_STEP, key); } @@ -37,7 +37,7 @@ public class TOPT extends HOTP { * @param timeStep 日期步进,用于生成移动因子(moving factor) * @param key 共享密码,RFC 4226要求最少128位 */ - public TOPT(Duration timeStep, byte[] key) { + public TOTP(Duration timeStep, byte[] key) { this(timeStep, DEFAULT_PASSWORD_LENGTH, key); } @@ -48,7 +48,7 @@ public class TOPT extends HOTP { * @param passwordLength 密码长度,可以是6,7,8 * @param key 共享密码,RFC 4226要求最少128位 */ - public TOPT(Duration timeStep, int passwordLength, byte[] key) { + public TOTP(Duration timeStep, int passwordLength, byte[] key) { this(timeStep, passwordLength, HOTP_HMAC_ALGORITHM, key); } @@ -60,7 +60,7 @@ public class TOPT extends HOTP { * @param algorithm HMAC算法枚举 * @param key 共享密码,RFC 4226要求最少128位 */ - public TOPT(Duration timeStep, int passwordLength, HmacAlgorithm algorithm, byte[] key) { + public TOTP(Duration timeStep, int passwordLength, HmacAlgorithm algorithm, byte[] key) { super(passwordLength, algorithm, key); this.timeStep = timeStep; } diff --git a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/opt/package-info.java b/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/package-info.java similarity index 88% rename from hutool-crypto/src/main/java/cn/hutool/crypto/digest/opt/package-info.java rename to hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/package-info.java index e496dd688..be6e2b0f0 100644 --- a/hutool-crypto/src/main/java/cn/hutool/crypto/digest/opt/package-info.java +++ b/hutool-crypto/src/main/java/cn/hutool/crypto/digest/otp/package-info.java @@ -11,4 +11,4 @@ * * @author looly */ -package cn.hutool.crypto.digest.opt; \ No newline at end of file +package cn.hutool.crypto.digest.otp; \ No newline at end of file