本文整理匯總了Java中org.apache.harmony.security.provider.crypto.SHA1Impl.updateHash方法的典型用法代碼示例。如果您正苦於以下問題:Java SHA1Impl.updateHash方法的具體用法?Java SHA1Impl.updateHash怎麽用?Java SHA1Impl.updateHash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.harmony.security.provider.crypto.SHA1Impl
的用法示例。
在下文中一共展示了SHA1Impl.updateHash方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateSeed
import org.apache.harmony.security.provider.crypto.SHA1Impl; //導入方法依賴的package包/類
private void updateSeed(byte[] bytes) {
// on call: "seed" contains current bytes and current hash;
// on return: "seed" contains new current bytes and possibly new current hash
// if after adding, seed bytes overfill its buffer
SHA1Impl.updateHash(seed, bytes, 0, bytes.length - 1);
seedLength += bytes.length;
}
示例2: engineUpdate
import org.apache.harmony.security.provider.crypto.SHA1Impl; //導入方法依賴的package包/類
/**
* Updates current message. <BR>
*
* The method overrides "engineUpdate(byte[],int,int)" in class MessageDigestSpi. <BR>
*
* The method silently returns if "len" <= 0.
*
* @param
* input a byte array
* @param
* offset a number of first byte in the "input" array to use for updating
* @param
* len a number of bytes to use
*
* @throws NullPointerException
* if null is passed to the "buf" argument
*
* @throws IllegalArgumentException
* if offset > buf.length or len > buf.length or
* (len + offset) > buf.length
* @throws ArrayIndexOutOfBoundsException
* offset < 0
*/
protected void engineUpdate(byte[] input, int offset, int len) {
if ( input == null ) {
throw new IllegalArgumentException(Messages.getString("security.166")); //$NON-NLS-1$
}
if ( len <= 0 ) {
return;
}
if ( offset < 0 ) {
throw new ArrayIndexOutOfBoundsException(Messages.getString("security.165", offset)); //$NON-NLS-1$
}
if ( offset > input.length || len > input.length || (len + offset) > input.length ) {
throw new IllegalArgumentException(
Messages.getString("security.167")); //$NON-NLS-1$
}
SHA1Impl.updateHash(buffer, input, offset, offset + len -1 );
messageLength += len;
}