Search in sources :

Example 1 with MD5

use of cn.hutool.crypto.digest.MD5 in project hutool by looly.

the class Md5Test method md5To16Test.

@Test
public void md5To16Test() {
    String hex16 = new MD5().digestHex16("中国");
    Assert.assertEquals(16, hex16.length());
    Assert.assertEquals("cb143acd6c929826", hex16);
}
Also used : MD5(cn.hutool.crypto.digest.MD5) Test(org.junit.Test)

Example 2 with MD5

use of cn.hutool.crypto.digest.MD5 in project hutool by dromara.

the class Md5Test method md5To16Test.

@Test
public void md5To16Test() {
    String hex16 = new MD5().digestHex16("中国");
    Assert.assertEquals(16, hex16.length());
    Assert.assertEquals("cb143acd6c929826", hex16);
}
Also used : MD5(cn.hutool.crypto.digest.MD5) Test(org.junit.Test)

Aggregations

MD5 (cn.hutool.crypto.digest.MD5)2 Test (org.junit.Test)2