J
jb7991
Unregistered / Unconfirmed
GUEST, unregistred user!
如下所示,是一段信息摘要的加密,源自JDK文档,请问如何读出
byte[] toChapter1Digest = tc1.digest;
的加密结果,是读byte值吗,需要定义一个字符串吗,谁能给我一个例子程序,谢谢。
=====================================================
MessageDigest md = MessageDigest.getInstance("SHA");
try {
md.update(toChapter1);
MessageDigest tc1 = md.clone();
byte[] toChapter1Digest = tc1.digest;
md.update(toChapter2);
...etc.
} catch (CloneNotSupportedException cnse) {
throw new DigestException("couldn't make digest of partial content");
}
byte[] toChapter1Digest = tc1.digest;
的加密结果,是读byte值吗,需要定义一个字符串吗,谁能给我一个例子程序,谢谢。
=====================================================
MessageDigest md = MessageDigest.getInstance("SHA");
try {
md.update(toChapter1);
MessageDigest tc1 = md.clone();
byte[] toChapter1Digest = tc1.digest;
md.update(toChapter2);
...etc.
} catch (CloneNotSupportedException cnse) {
throw new DigestException("couldn't make digest of partial content");
}