ExRingRing.Infrastructure.HashAlgorithms (ExRingRing v0.1.1)

Copy Markdown View Source

Hash algorithms registry and factory.

Summary

Functions

Gets the hash algorithm module.

Calculates hash using the specified algorithm.

Gets hash byte size for algorithm.

Checks if algorithm is supported.

Gets list of supported algorithms.

Functions

get_algorithm(algo)

@spec get_algorithm(atom()) :: module()

Gets the hash algorithm module.

hash(algo, data)

@spec hash(atom(), term()) :: non_neg_integer()

Calculates hash using the specified algorithm.

hash_byte_size(algo)

@spec hash_byte_size(atom()) :: pos_integer()

Gets hash byte size for algorithm.

supported?(algo)

@spec supported?(atom()) :: boolean()

Checks if algorithm is supported.

supported_algorithms()

@spec supported_algorithms() :: [atom()]

Gets list of supported algorithms.