本文整理汇总了Java中fr.cryptohash.MD5类的典型用法代码示例。如果您正苦于以下问题:Java MD5类的具体用法?Java MD5怎么用?Java MD5使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MD5类属于fr.cryptohash包,在下文中一共展示了MD5类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testMD5
import fr.cryptohash.MD5; //导入依赖的package包/类
/**
* Test MD5 implementation.
*/
private static void testMD5()
{
Digest dig = new MD5();
testKat(dig, "", "d41d8cd98f00b204e9800998ecf8427e");
testKat(dig, "a", "0cc175b9c0f1b6a831c399e269772661");
testKat(dig, "abc", "900150983cd24fb0d6963f7d28e17f72");
testKat(dig, "message digest",
"f96b697d7cb7938d525a2f31aaf161d0");
testKat(dig, "abcdefghijklmnopqrstuvwxyz",
"c3fcd3d76192e4007dfb496cca67e13b");
testKat(dig, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu"
+ "vwxyz0123456789",
"d174ab98d277d9f5a5611c2c9f419d9f");
testKat(dig, "1234567890123456789012345678901234567890123456789"
+ "0123456789012345678901234567890",
"57edf4a22be3c955ac49da2e2107b67a");
testKatMillionA(dig, "7707d6ae4e027c70eea2a935c2296f21");
testCollision(dig,
"d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab40"
+ "04583eb8fb7f8955ad340609f4b30283e488832571415a08"
+ "5125e8f7cdc99fd91dbdf280373c5b960b1dd1dc417b9ce4"
+ "d897f45a6555d535739ac7f0ebfd0c3029f166d109b18f75"
+ "277f7930d55ceb22e8adba79cc155ced74cbdd5fc5d36db1"
+ "9b0ad835cca7e3",
"d131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab40"
+ "04583eb8fb7f8955ad340609f4b30283e4888325f1415a08"
+ "5125e8f7cdc99fd91dbd7280373c5b960b1dd1dc417b9ce4"
+ "d897f45a6555d535739a47f0ebfd0c3029f166d109b18f75"
+ "277f7930d55ceb22e8adba794c155ced74cbdd5fc5d36db1"
+ "9b0a5835cca7e3");
testCollision(dig,
"d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab40"
+ "04583eb8fb7f8955ad340609f4b30283e488832571415a08"
+ "5125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae"
+ "6dacd436c919c6dd53e2b487da03fd02396306d248cda0e9"
+ "9f33420f577ee8ce54b67080a80d1ec69821bcb6a8839396"
+ "f9652b6ff72a70",
"d131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab40"
+ "04583eb8fb7f8955ad340609f4b30283e4888325f1415a08"
+ "5125e8f7cdc99fd91dbd7280373c5bd8823e3156348f5bae"
+ "6dacd436c919c6dd53e23487da03fd02396306d248cda0e9"
+ "9f33420f577ee8ce54b67080280d1ec69821bcb6a8839396"
+ "f965ab6ff72a70");
reportSuccess("MD5");
}
示例2: testMD5
import fr.cryptohash.MD5; //导入依赖的package包/类
@Test
public void testMD5() {
Digest dig = new MD5();
testKat(dig, "", "d41d8cd98f00b204e9800998ecf8427e");
testKat(dig, "a", "0cc175b9c0f1b6a831c399e269772661");
testKat(dig, "abc", "900150983cd24fb0d6963f7d28e17f72");
testKat(dig, "message digest",
"f96b697d7cb7938d525a2f31aaf161d0");
testKat(dig, "abcdefghijklmnopqrstuvwxyz",
"c3fcd3d76192e4007dfb496cca67e13b");
testKat(dig, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstu"
+ "vwxyz0123456789",
"d174ab98d277d9f5a5611c2c9f419d9f");
testKat(dig, "1234567890123456789012345678901234567890123456789"
+ "0123456789012345678901234567890",
"57edf4a22be3c955ac49da2e2107b67a");
testKatMillionA(dig, "7707d6ae4e027c70eea2a935c2296f21");
testCollision(dig,
"d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab40"
+ "04583eb8fb7f8955ad340609f4b30283e488832571415a08"
+ "5125e8f7cdc99fd91dbdf280373c5b960b1dd1dc417b9ce4"
+ "d897f45a6555d535739ac7f0ebfd0c3029f166d109b18f75"
+ "277f7930d55ceb22e8adba79cc155ced74cbdd5fc5d36db1"
+ "9b0ad835cca7e3",
"d131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab40"
+ "04583eb8fb7f8955ad340609f4b30283e4888325f1415a08"
+ "5125e8f7cdc99fd91dbd7280373c5b960b1dd1dc417b9ce4"
+ "d897f45a6555d535739a47f0ebfd0c3029f166d109b18f75"
+ "277f7930d55ceb22e8adba794c155ced74cbdd5fc5d36db1"
+ "9b0a5835cca7e3");
testCollision(dig,
"d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab40"
+ "04583eb8fb7f8955ad340609f4b30283e488832571415a08"
+ "5125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae"
+ "6dacd436c919c6dd53e2b487da03fd02396306d248cda0e9"
+ "9f33420f577ee8ce54b67080a80d1ec69821bcb6a8839396"
+ "f9652b6ff72a70",
"d131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab40"
+ "04583eb8fb7f8955ad340609f4b30283e4888325f1415a08"
+ "5125e8f7cdc99fd91dbd7280373c5bd8823e3156348f5bae"
+ "6dacd436c919c6dd53e23487da03fd02396306d248cda0e9"
+ "9f33420f577ee8ce54b67080280d1ec69821bcb6a8839396"
+ "f965ab6ff72a70");
reportSuccess("MD5");
}