本文整理了Java中okio.Buffer.sha256()
方法的一些代码示例,展示了Buffer.sha256()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Buffer.sha256()
方法的具体详情如下:
包路径:okio.Buffer
类名称:Buffer
方法名:sha256
暂无
代码示例来源:origin: square/okio
@Test public void hashEmptySha256Buffer() {
assertEquals(SHA256_empty, new Buffer().sha256());
}
代码示例来源:origin: square/okio
@Test public void hmacSha256EmptyBuffer() {
assertEquals(HMAC_SHA256_empty, new Buffer().sha256());
}
代码示例来源:origin: square/okio
System.out.println(" md5: " + buffer.md5().hex());
System.out.println(" sha1: " + buffer.sha1().hex());
System.out.println(" sha256: " + buffer.sha256().hex());
System.out.println(" sha512: " + buffer.sha512().hex());
System.out.println();
代码示例来源:origin: square/okio
@Test public void bufferSha256() {
assertEquals(SHA256_abc, new Buffer().writeUtf8("abc").sha256());
}
代码示例来源:origin: square/okio
@Test public void bufferHashIsNotDestructive() {
Buffer buffer = new Buffer();
buffer.writeUtf8("abc");
assertEquals(SHA256_abc, buffer.sha256());
assertEquals("abc", buffer.readUtf8());
buffer.writeUtf8("def");
assertEquals(SHA256_def, buffer.sha256());
assertEquals("def", buffer.readUtf8());
buffer.write(r32k);
assertEquals(SHA256_r32k, buffer.sha256());
assertEquals(r32k, buffer.readByteString());
}
}
内容来源于网络,如有侵权,请联系作者删除!