Returns the number of rounds (1, in this case) used to generate the hash output; this is included only so that Digest::SHA2 is consistent with other one-way hash functions that have variable number of rounds, like Haval and Tiger.

Haval can uses 3, 4, or 5 rounds, with 5 different output lengths: 128, 160, 192, 224, and 256 bits, thereby, having 15 variants. Tiger, on the other hand, outputs 192 bits of digest, using 3 rounds; but for added security, can also use 4 rounds.

add(LIST)

Hashes a string or a list of strings

For example,

$sha2obj->add($string1);
$sha2obj->add($string2, $string3, $string4);

addfile(*HANDLE)

Hashes a file whose file handle is HANDLE

reset()

Re-initializes the hash state of the SHA-2 object. Before calculating another digest, reset() refreshes the hash state, and is, therefore, functionally equivalent to the new() method, except that no SHA-2 object is created.

digest()

Generates the hash output as a binary string

hexdigest()

Generates a hexadecimal representation of the hash output

base64digest() (deprecated)

This will be removed in future releases; use b64digest() instead.

b64digest()

Generates a base64 representation of the hash output

clone()

Returns a copy of the SHA-2 object; useful when you want to preserve an intermediate value of the digest