4 import java.nio.ByteBuffer;
5 import spi.DigestImplementation;
7 /** MessageDigest extends MessageDigestSpi, that means the javadoc
9 * @author Jaroslav Tulach
11 public final class Digest {
12 private final DigestImplementation impl;
14 /** Factory method is better than constructor */
15 private Digest(DigestImplementation impl) {
19 /** Factory method to create digest for an algorithm.
21 public static Digest getInstance(String algorithm) {
26 // these methods are kept the same as in original MessageDigest,
27 // but for simplicity choose just some from the original API
30 public byte[] digest(ByteBuffer bb) {