当前位置: 首页>>代码示例>>Java>>正文


Java RIPEMD类代码示例

本文整理汇总了Java中fr.cryptohash.RIPEMD的典型用法代码示例。如果您正苦于以下问题:Java RIPEMD类的具体用法?Java RIPEMD怎么用?Java RIPEMD使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RIPEMD类属于fr.cryptohash包,在下文中一共展示了RIPEMD类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testRIPEMD

import fr.cryptohash.RIPEMD; //导入依赖的package包/类
/**
 * Test RIPEMD implementation.
 */
private static void testRIPEMD()
{
	Digest dig = new RIPEMD();
	testKat(dig, "",
		"9f73aa9b372a9dacfb86a6108852e2d9");
	testKat(dig, "a",
		"486f74f790bc95ef7963cd2382b4bbc9");
	testKat(dig, "abc",
		"3f14bad4c2f9b0ea805e5485d3d6882d");
	testKat(dig, "message digest",
		"5f5c7ebe1abbb3c7036482942d5f9d49");
	testKat(dig, "abcdefghijklmnopqrstuvwxyz",
		"ff6e1547494251a1cca6f005a6eaa2b4");
	testKat(dig, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr"
		+ "stuvwxyz0123456789",
		"ff418a5aed3763d8f2ddf88a29e62486");
	testKat(dig, "12345678901234567890123456789012345678901234"
		+ "567890123456789012345678901234567890",
		"dfd6b45f60fe79bbbde87c6bfc6580a5");

	testCollision(dig,
		"8eaf9f5779f5ec09ba6a4a5711354178a410b4a29f6c2fad2c"
		+ "20560b1179754de7aade0bf291bc787d6dbc47b1d1bd9a15"
		+ "205da4ff047181a8584726a54e0661",
		"8eaf9f5779f5ec09ba6a4a5711355178a410b4a29f6c2fad2c"
		+ "20560b1179754de7aade0bf291bc787d6dc0c7b1d1bd9a15"
		+ "205da4ff047181a8584726a54e06e1");

	testCollision(dig,
		"8eaf9f5779f5ec09ba6a4a5711354178a410b4a29f6c2fad2c"
		+ "20560b1179754de7aade0bf291bc787d6dbc47b1d1bd9a15"
		+ "205da4ff04a5a0a8588db1b6660ce7",
		"8eaf9f5779f5ec09ba6a4a5711355178a410b4a29f6c2fad2c"
		+ "20560b1179754de7aade0bf291bc787d6dc0c7b1d1bd9a15"
		+ "205da4ff04a5a0a8588db1b6660c67");

	reportSuccess("RIPEMD");
}
 
开发者ID:muhatzg,项目名称:burstcoin,代码行数:42,代码来源:TestDigest.java

示例2: testRIPEMD

import fr.cryptohash.RIPEMD; //导入依赖的package包/类
@Test
public void testRIPEMD() {
    Digest dig = new RIPEMD();
    testKat(dig, "",
            "9f73aa9b372a9dacfb86a6108852e2d9");
    testKat(dig, "a",
            "486f74f790bc95ef7963cd2382b4bbc9");
    testKat(dig, "abc",
            "3f14bad4c2f9b0ea805e5485d3d6882d");
    testKat(dig, "message digest",
            "5f5c7ebe1abbb3c7036482942d5f9d49");
    testKat(dig, "abcdefghijklmnopqrstuvwxyz",
            "ff6e1547494251a1cca6f005a6eaa2b4");
    testKat(dig, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqr"
            + "stuvwxyz0123456789",
            "ff418a5aed3763d8f2ddf88a29e62486");
    testKat(dig, "12345678901234567890123456789012345678901234"
            + "567890123456789012345678901234567890",
            "dfd6b45f60fe79bbbde87c6bfc6580a5");

    testCollision(dig,
            "8eaf9f5779f5ec09ba6a4a5711354178a410b4a29f6c2fad2c"
                    + "20560b1179754de7aade0bf291bc787d6dbc47b1d1bd9a15"
                    + "205da4ff047181a8584726a54e0661",
            "8eaf9f5779f5ec09ba6a4a5711355178a410b4a29f6c2fad2c"
                    + "20560b1179754de7aade0bf291bc787d6dc0c7b1d1bd9a15"
                    + "205da4ff047181a8584726a54e06e1");

    testCollision(dig,
            "8eaf9f5779f5ec09ba6a4a5711354178a410b4a29f6c2fad2c"
                    + "20560b1179754de7aade0bf291bc787d6dbc47b1d1bd9a15"
                    + "205da4ff04a5a0a8588db1b6660ce7",
            "8eaf9f5779f5ec09ba6a4a5711355178a410b4a29f6c2fad2c"
                    + "20560b1179754de7aade0bf291bc787d6dc0c7b1d1bd9a15"
                    + "205da4ff04a5a0a8588db1b6660c67");

    reportSuccess("RIPEMD");
}
 
开发者ID:jnorthrup,项目名称:sphlib,代码行数:39,代码来源:RIPEMDTest.java


注:本文中的fr.cryptohash.RIPEMD类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。