mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此BCD标记为弃用
This commit is contained in:
@@ -8,7 +8,9 @@ import cn.hutool.core.lang.Assert;
|
||||
* see http://cuisuqiang.iteye.com/blog/1429956
|
||||
* @author Looly
|
||||
*
|
||||
* @deprecated 由于对于ASCII的编码解码有缺陷,且这种BCD实现并不规范,因此会在6.0.0中移除
|
||||
*/
|
||||
@Deprecated
|
||||
public class BCD {
|
||||
|
||||
/**
|
||||
|
@@ -7,11 +7,11 @@ public class BCDTest {
|
||||
|
||||
@Test
|
||||
public void bcdTest(){
|
||||
String strForTest = "123456ABCDEF";
|
||||
final String strForTest = "123456ABCDEF";
|
||||
|
||||
//转BCD
|
||||
byte[] bcd = BCD.strToBcd(strForTest);
|
||||
String str = BCD.bcdToStr(bcd);
|
||||
final byte[] bcd = BCD.strToBcd(strForTest);
|
||||
final String str = BCD.bcdToStr(bcd);
|
||||
//解码BCD
|
||||
Assert.assertEquals(strForTest, str);
|
||||
}
|
||||
|
Reference in New Issue
Block a user