strongduanmu commented on code in PR #23030:
URL: https://github.com/apache/shardingsphere/pull/23030#discussion_r1055166723


##########
features/encrypt/core/src/main/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithm.java:
##########
@@ -154,17 +154,13 @@ private String digest(final String plainValue) {
         StringBuilder result = new StringBuilder(plainValue.length());
         for (char each : plainValue.toCharArray()) {
             char maskedChar = getMaskedChar(each);
-            if ('%' == maskedChar) {

Review Comment:
   If the result of the mask operation is % or _, should we keep the original 
character?



##########
docs/document/content/features/encrypt/limitations.cn.md:
##########
@@ -4,6 +4,7 @@ weight = 2
 +++
 
 - 需自行处理数据库中原始的存量数据;
+- 模糊查询支持%、_,暂不支持escape;

Review Comment:
   Please add a space between chinese characters and symbols(or english word).



##########
features/encrypt/core/src/test/java/org/apache/shardingsphere/encrypt/algorithm/like/CharDigestLikeEncryptAlgorithmTest.java:
##########
@@ -58,6 +58,8 @@ private Properties createProperties() {
     public void assertEncrypt() {
         
assertThat(englishLikeEncryptAlgorithm.encrypt("1234567890%abcdefghijklmnopqrstuvwxyz%ABCDEFGHIJKLMNOPQRSTUVWXYZ",
                 mock(EncryptContext.class)), 
is("0145458981%`adedehihilmlmpqpqtutuxyxy%@ADEDEHIHILMLMPQPQTUTUXYXY"));
+        assertThat(englishLikeEncryptAlgorithm.encrypt("_1234__5678__",
+                mock(EncryptContext.class)), is("_0145__4589__"));

Review Comment:
   Can you add integration test for `_` support?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to