Table of Contents

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

value string

The input string to be hashed. If null or empty, an empty string is returned.

algorithm HashHelper.HashAlgorithmType

The 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

value string

Returns

string

ComputeSHA512Hash(string?)

Computes a SHA-512 hash for the given string.

public static string ComputeSHA512Hash(string? value)

Parameters

value string

Returns

string