TrueUpdate Core 0.1.7

net.java.trueupdate.core.io
Class MessageDigests

java.lang.Object
  extended by net.java.trueupdate.core.io.MessageDigests

@Immutable
public class MessageDigests
extends Object

Provides message digest functions.

Author:
Christian Schlichtherle

Method Summary
static MessageDigest create(String algorithm)
          Returns a new message digest for the given algorithm name.
static MessageDigest sha1()
          Returns a new SHA-1 message digest.
static void updateDigestFrom(MessageDigest digest, Source source)
          Updates the given message digest with the binary data from the given source.
static String valueOf(MessageDigest digest)
          Returns a positive, big-endian integer in hexadecimal string notation representing the value of the given message digest.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static MessageDigest create(String algorithm)
Returns a new message digest for the given algorithm name.

Parameters:
algorithm - the algorithm name.
Throws:
IllegalArgumentException - if no implementation of the algorithm is found.

sha1

public static MessageDigest sha1()
Returns a new SHA-1 message digest.


updateDigestFrom

public static void updateDigestFrom(MessageDigest digest,
                                    Source source)
                             throws IOException
Updates the given message digest with the binary data from the given source.

Parameters:
digest - the message digest to update.
source - the source for reading the binary data.
Throws:
IOException

valueOf

public static String valueOf(MessageDigest digest)
Returns a positive, big-endian integer in hexadecimal string notation representing the value of the given message digest. This is the canonical representation of message digests.

Parameters:
digest - a message digest.
Returns:
a positive, big-endian integer in hexadecimal string notation representing the value of the message digest.

TrueUpdate Core 0.1.7

Copyright © 2013 Stimulus Software. All rights reserved.