hash.java

来自「JAVA的加密源程序」· Java 代码 · 共 31 行

JAVA
31
字号
/*Christoforos Pirillos @ Villanova University - May 1999based on code from the book "Java Network Programming" by Hughes*/package encryption;/**This class is the generic superclass for all hash functions. Hashfunctions are used to compute message digests; a message digest is, as thename suggests, a summary of the message.*/public abstract class Hash {/**Returns a digest from the subarray of text consisting of len bytes,from offset off.*/public abstract byte[] digest (byte[] text, int off, int len);/**Computes a digest for the whole array text using the previous method.*/public byte[] digest (byte[] text) {	return digest (text, 0, text.length);}/**Returns the digest size returned by this algorithm. MD5 returns 16bytes. SHS returns 20 bytes.*/public abstract int digestSize();} /*end of class Hash*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?