Class HashHelper
- Namespace
- NuvTools.Security.Helpers
- Assembly
- NuvTools.Security.dll
Provides helper methods for computing cryptographic hashes.
public static class HashHelper
- Inheritance
-
HashHelper
- Inherited Members
Methods
ComputeHash(string?, HashAlgorithmType)
Computes the cryptographic hash of a string using the specified algorithm.
public static string ComputeHash(string? value, HashHelper.HashAlgorithmType algorithm = HashAlgorithmType.SHA256)
Parameters
valuestringThe input string to be hashed. If null or empty, an empty string is returned.
algorithmHashHelper.HashAlgorithmTypeThe hash algorithm to use. Defaults to SHA256.
Returns
- string
A lowercase hexadecimal representation of the computed hash.
ComputeSHA256Hash(string?)
Computes a SHA-256 hash for the given string.
public static string ComputeSHA256Hash(string? value)
Parameters
valuestring
Returns
ComputeSHA512Hash(string?)
Computes a SHA-512 hash for the given string.
public static string ComputeSHA512Hash(string? value)
Parameters
valuestring