mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -205,7 +205,7 @@ public class RSATest {
|
||||
final byte[] keyBytes = Base64.decode(publicKeyStr);
|
||||
final PublicKey publicKey = KeyUtil.generateRSAPublicKey(keyBytes);
|
||||
|
||||
final byte[] data = RandomUtil.randomStringLower("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", 16).getBytes();
|
||||
final byte[] data = RandomUtil.randomString("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", 16).getBytes();
|
||||
//长度不满足128补0
|
||||
final byte[] finalData = ArrayUtil.resize(data, 128);
|
||||
|
||||
|
@@ -30,7 +30,7 @@ public class FPETest {
|
||||
final FPE fpe = new FPE(FPE.FPEMode.FF1, keyBytes, numberMapper, null);
|
||||
|
||||
// 原始数据
|
||||
final String phone = RandomUtil.randomStringLower("A0123456789", 13);
|
||||
final String phone = RandomUtil.randomString("A0123456789", 13);
|
||||
final String encrypt = fpe.encrypt(phone);
|
||||
// 加密后与原密文长度一致
|
||||
Assertions.assertEquals(phone.length(), encrypt.length());
|
||||
@@ -49,7 +49,7 @@ public class FPETest {
|
||||
final FPE fpe = new FPE(FPE.FPEMode.FF3_1, keyBytes, numberMapper, null);
|
||||
|
||||
// 原始数据
|
||||
final String phone = RandomUtil.randomStringLower("A0123456789", 13);
|
||||
final String phone = RandomUtil.randomString("A0123456789", 13);
|
||||
final String encrypt = fpe.encrypt(phone);
|
||||
// 加密后与原密文长度一致
|
||||
Assertions.assertEquals(phone.length(), encrypt.length());
|
||||
|
Reference in New Issue
Block a user