You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by tu...@apache.org on 2022/11/17 02:09:19 UTC
[shardingsphere] branch master updated: Optimize CharDigestLikeEncryptAlgorithm uppercase letter encryption effect (#22215)
This is an automated email from the ASF dual-hosted git repository.
tuichenchuxin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 30ec9db2b5c Optimize CharDigestLikeEncryptAlgorithm uppercase letter encryption effect (#22215)
30ec9db2b5c is described below
commit 30ec9db2b5cb9ade875a406c05cc8a3898dbfba8
Author: gxxiong <xi...@foxmail.com>
AuthorDate: Thu Nov 17 10:09:12 2022 +0800
Optimize CharDigestLikeEncryptAlgorithm uppercase letter encryption effect (#22215)
Signed-off-by: gxxiong <xi...@foxmail.com>
Signed-off-by: gxxiong <xi...@foxmail.com>
---
.../encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java | 2 +-
.../encrypt/algorithm/like/CharDigestLikeEncryptAlgorithmTest.java | 5 +++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java
index 40cf608078a..5cfc7711699 100644
--- a/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java
+++ b/features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java
@@ -48,7 +48,7 @@ public final class CharDigestLikeEncryptAlgorithm implements EncryptAlgorithm<Ob
private static final int DEFAULT_DELTA = 1;
- private static final int DEFAULT_MASK = 0b1111_1011_1101;
+ private static final int DEFAULT_MASK = 0b1111_0111_1101;
private static final int DEFAULT_START = 0x4e00;
diff --git a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithmTest.java b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithmTest.java
index 280320d01be..9005be5818c 100644
--- a/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithmTest.java
+++ b/features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithmTest.java
@@ -55,12 +55,13 @@ public final class CharDigestLikeEncryptAlgorithmTest {
@Test
public void assertEncrypt() {
- assertThat(encryptAlgorithm.encrypt("test", mock(EncryptContext.class)), is("5$45"));
+ assertThat(encryptAlgorithm.encrypt("1234567890%abcdefghijklmnopqrstuvwxyz%ABCDEFGHIJKLMNOPQRSTUVWXYZ",
+ mock(EncryptContext.class)), is("0145458981%`adedehihilmlmpqpqtutuxyxy%@ADEDEHIHILMLMPQPQTUTUXYXY"));
}
@Test
public void assertEncryptWithChineseChar() {
- assertThat(chineseLikeEncryptAlgorithm.encrypt("中国", mock(EncryptContext.class)), is("娝侰"));
+ assertThat(chineseLikeEncryptAlgorithm.encrypt("中国", mock(EncryptContext.class)), is("婝估"));
}
@Test