HashRequest

A {@code HashRequest} is composed of data that will be used by a {@link HashService} to compute a hash (aka 'digest'). While you can instantiate a concrete {@code HashRequest} class directly, most will find using the {@link HashRequest.Builder} more convenient.

@see HashRequest.Builder

Members

Classes

Builder
class Builder

A Builder class representing the Builder design pattern for constructing {@link HashRequest} instances.

Functions

getAlgorithmName
string getAlgorithmName()

Returns the name of the hash algorithm the {@code HashService} should use when computing the {@link Hash}, or {@code null} if the default algorithm configuration of the {@code HashService} should be used. A non-null value overrides the {@code HashService}'s configuration for a single request. <p/> Note that a {@code HashService} is free to ignore this value if it determines that the algorithm is not sufficient to meet a desired level of security.

getIterations
int getIterations()

Returns the number of requested hash iterations to be performed when computing the final {@code Hash} result. A non-positive (0 or less) indicates that the {@code HashService}'s default iteration configuration should be used. A positive value overrides the {@code HashService}'s configuration for a single request. <p/> Note that a {@code HashService} is free to ignore this number if it determines the number is not sufficient to meet a desired level of security.

getSalt
ByteSource getSalt()

Returns a salt to be used by the {@link HashService} during hash computation, or {@code null} if no salt is provided as part of the request. <p/> Note that a {@code null} value does not necessarily mean a salt won't be used at all - it just means that the request didn't include one. The servicing {@link HashService} is free to provide a salting strategy for a request, even if the request did not specify one.

getSource
ByteSource getSource()

Returns the source data that will be hashed by a {@link HashService}. For example, this might be a {@code ByteSource} representation of a password, or file, etc.

Meta