mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-08-18 20:38:02 +08:00
fix Base32
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package cn.hutool.core.codec;
|
||||
|
||||
import cn.hutool.core.util.RandomUtil;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
@@ -13,8 +14,20 @@ public class Base32Test {
|
||||
|
||||
String decodeStr = Base32.decodeStr(encode);
|
||||
Assert.assertEquals(a, decodeStr);
|
||||
}
|
||||
|
||||
decodeStr = Base32.decodeStr("4S6KNZNOW3TJRL7EXCAOJOFK5GOZ5ZNYXDUZLP7HTKCOLLMX46WKNZFYWI");
|
||||
@Test
|
||||
public void encodeAndDecodeRandomTest(){
|
||||
String a = RandomUtil.randomString(RandomUtil.randomInt(1000));
|
||||
String encode = Base32.encode(a);
|
||||
String decodeStr = Base32.decodeStr(encode);
|
||||
Assert.assertEquals(a, decodeStr);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void decodeTest(){
|
||||
String a = "伦家是一个非常长的字符串";
|
||||
String decodeStr = Base32.decodeStr("4S6KNZNOW3TJRL7EXCAOJOFK5GOZ5ZNYXDUZLP7HTKCOLLMX46WKNZFYWI");
|
||||
Assert.assertEquals(a, decodeStr);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user