Skip to content

Commit 631ce57

Browse files
author
Dynesshely
committed
✔️ Test: Compress passed HashTest
1 parent 11eaa39 commit 631ce57

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Algorithm.UnitTest/HashTest.cs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,35 @@ public void FeasibilityTest()
3737
}
3838
}
3939

40+
/// <summary>
41+
/// 哈希算法64位压缩器测试
42+
/// </summary>
43+
[TestMethod]
44+
public void FeasibilityTest_WithCompress()
45+
{
46+
string[] testData = new string[12]
47+
{
48+
"SHVIOSJDifjDKljkJ$*F$W*938r5834r89we9fIOSFJOIS", // 基础 ASCII 测试
49+
"SHVIOSJDifjDKljkJ$*F$W*939r5834r89we9fIOSFJOIS", // 微变更测试 938 -> 939
50+
"DHSJKfkl5262fads43234LKgjsd#$%$%#$%fjLKSdkfJLD", // 大变更测试
51+
"的是抗拒那就客服的撒滤镜打算离开房间啊w8e9832", // 中文测试
52+
"的是抗拒那就客服的撒滤镜打算离开房间啊w8e9132", // 中文微变更测试 9832 -> 9132
53+
"的dsa是fsd抗f拒s阿f斯是25是34会3卡死了的肌肤", // 中文大变更测试
54+
"^$#%#$@T#@$@#$%#@^#$#@^#@%$&$#*$!*()$*@)($*)(#@", // 纯符号测试
55+
"^$#%#$@T#@$@#$%#@^#$#@!#@%$&$#*$!*()$*@)($*)(#@", // 纯符号微变更测试 ^ -> !
56+
"^$#%#*$(**(&#@(*$#*%(@$*(#@()#@09(()$*!)#(@*(#@", // 纯符号大变更测试
57+
"🐦🐡🐣🐱💣", // Emoji(Unicode) 测试
58+
"🐦🐡💯🐱💣", // Emoji(Unicode) 小变更测试 🐣 -> 💯
59+
"💬💰💮🕷🚩" // Emoji(Unicode) 大变更测试
60+
};
61+
for (int i = 0; i < testData.Length; ++i)
62+
{
63+
Console.WriteLine(testData[i]);
64+
Console.WriteLine(Hash.FromString_ToHex_WithoutCompress(testData[i]));
65+
Console.WriteLine(Hash.FromString_ToHex(testData[i], false));
66+
}
67+
}
68+
4069
/// <summary>
4170
/// 短长度字符串Hash测试
4271
/// </summary>

0 commit comments

Comments
 (0)