HashingUtil

HashingUtil class provides utility methods for hashing data using various algorithms. It offers a simple and convenient way to generate hash values for different data types. The class is designed to be thread-safe.

Methods

md2Hex(String: str): String

Calculates the MD2 digest and returns the value as a 32 character hex string.

@paramstr — The string to hash.

@return — MD2 digest as a hex string.

HashingUtil.md2Hex("Some data");

md5Hex(String: str): String

Calculates the MD5 digest and returns the value as a 32 character hex string.

@paramstr — The string to hash.

@return — MD5 digest as a hex string.

HashingUtil.md5Hex("Some data");

sha1Hex(String: str): String

Calculates the SHA-1 digest and returns the value as a hex string.

@paramstr — The string to hash.

@return — SHA-1 digest as a hex string.

HashingUtil.sha1Hex("Some data");

sha256Hex(String: str): String

Calculates the SHA-256 digest and returns the value as a hex string.

@paramstr — The string to hash.

@return — SHA-256 digest as a hex string.

HashingUtil.sha256Hex("Some data");

sha384Hex(String: str): String

Calculates the SHA-384 digest and returns the value as a hex string.

@paramstr — The string to hash.

@return — SHA-384 digest as a hex string.

HashingUtil.sha384Hex("Some data");

sha3_224Hex(String: str): String

Calculates the SHA3-224 digest and returns the value as a hex string.

@paramstr — The string to hash.

@return — SHA3-224 digest as a hex string.

HashingUtil.sha3_224Hex("Some data");

sha3_256Hex(String: str): String

Calculates the SHA3-256 digest and returns the value as a hex string.

@paramstr — The string to hash.

@return — SHA3-256 digest as a hex string.

HashingUtil.sha3_256Hex("Some data");

sha3_384Hex(String: str): String

Calculates the SHA3-384 digest and returns the value as a hex string.

@paramstr — The string to hash.

@return — SHA3-384 digest as a hex string.

HashingUtil.sha3_384Hex("Some data");

sha3_512Hex(String: str): String

Calculates the SHA3-512 digest and returns the value as a hex string.

@paramstr — The string to hash.

@return — SHA3-512 digest as a hex string.

HashingUtil.sha3_512Hex("Some data");

sha512Hex(String: str): String

Calculates the SHA-512 digest and returns the value as a hex string.

@paramstr — The string to hash.

@return — SHA-512 digest as a hex string.

HashingUtil.sha512Hex("Some data");

sha512_256Hex(String: str): String

Calculates the SHA-512/256 digest and returns the value as a hex string.

@paramstr — The string to hash.

@return — SHA-512/256 digest as a hex string.

HashingUtil.sha512_256Hex("Some data");

Last updated