public abstract class MessageDigest extends java.lang.Object
MessageDigest object starts out initialized. The data is
processed through it using the
method. At any point
reset can be called
to reset the digest. Once all the data to be updated has been
digest method should
be called to complete the hash computation.
digest method can be called once for a given number
of updates. After
digest has been called,
object is reset to its initialized state.
|Modifier and Type||Method and Description|
Completes the hash computation by performing final operations such as padding.
Resets the digest for further use.
Updates the digest using the specified array of bytes, starting at the specified offset.
public static MessageDigest getInstance(java.lang.String algorithm) throws NoSuchAlgorithmException
MessageDigestobject that implements the specified digest algorithm.
algorithm- the name of the algorithm requested. See Appendix A in the Java Cryptography Architecture API Specification & Reference for information about standard algorithm names.
NoSuchAlgorithmException- if the algorithm is not available in the caller's environment.
public void update(byte input, int offset, int len)
input- the array of bytes.
offset- the offset to start from in the array of bytes.
len- the number of bytes to use, starting at
public int digest(byte buf, int offset, int len) throws DigestException
buf- output buffer for the computed digest
offset- offset into the output buffer to begin storing the digest
len- number of bytes within buf allotted for the digest
DigestException- if an error occurs.
public void reset()
Copyright © 2013, Oracle and/or its affiliates. All rights reserved.
Use is subject to License Terms. Your use of this web site or any of its contents or software indicates your agreement to be bound by these License Terms.