Acquires the specified {@code source} argument's bytes and returns them in the form of a {@code ByteSource} instance. <p/> This implementation merely delegates to the convenience {@link #toByteSource(Object)} method for generic conversion. Can be overridden by subclasses for source-specific conversion.
Acquires the specified {@code salt} argument's bytes and returns them in the form of a {@code ByteSource} instance. <p/> This implementation merely delegates to the convenience {@link #toByteSource(Object)} method for generic conversion. Can be overridden by subclasses for salt-specific conversion.
Converts a given object into a {@code ByteSource} instance. Assumes the object can be converted to bytes.
Returns the {@link java.security.MessageDigest MessageDigest} algorithm name to use when performing the hash.
Sets the raw bytes stored by this hash instance. <p/> The bytes are kept in raw form - they will not be hashed/changed. This is primarily a utility method for constructing a Hash instance when the hashed value is already known.
Sets the iterations used to previously compute AN ALREADY GENERATED HASH. <p/> This is provided <em>ONLY</em> to reconstitute an already-created Hash instance. It should ONLY ever be invoked when re-constructing a hash instance from an already-hashed value.
Sets the salt used to previously compute AN ALREADY GENERATED HASH. <p/> This is provided <em>ONLY</em> to reconstitute a Hash instance that has already been computed. It should ONLY ever be invoked when re-constructing a hash instance from an already-hashed value.
Hashes the specified byte array without a salt for a single iteration.
Hashes the specified byte array using the given {@code salt} for a single iteration.
Hashes the specified byte array using the given {@code salt} for the specified number of iterations.
Returns a hex-encoded string of the underlying {@link #getBytes byte array}. <p/> This implementation caches the resulting hex string so multiple calls to this method remain efficient. However, calling {@link #setBytes setBytes} will null the cached value, forcing it to be recalculated the next time this method is called.
Returns a Base64-encoded string of the underlying {@link #getBytes byte array}. <p/> This implementation caches the resulting Base64 string so multiple calls to this method remain efficient. However, calling {@link #setBytes setBytes} will null the cached value, forcing it to be recalculated the next time this method is called.
Simple implementation that merely returns {@link #toHex() toHex()}.
Returns {@code true} if the specified object is a Hash and its {@link #getBytes byte array} is identical to this Hash's byte array, {@code false} otherwise.
Simply returns toHex().hashCode();
Generates an MD5 Hash (RFC 1321) from a given input <tt>source</tt> with an optional <tt>salt</tt> and hash iterations. <p/> See the {@link SimpleHash SimpleHash} parent class JavaDoc for a detailed explanation of Hashing techniques and how the overloaded constructors function.