Show / Hide Table of Contents

Class HashDigestExtensions

Augments types to have some shortcut methods dealing with HashDigest<T> values.

Inheritance
System.Object
HashDigestExtensions
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Libplanet.Common
Assembly: Libplanet.Common.dll
Syntax
public static class HashDigestExtensions

Methods

| Improve this Doc View Source

ToHashDigest<T>(String)

Converts a given hexadecimal representation of a digest into a HashDigest<T> object.

This is a shortcut of FromString(String) method.

This is an inverse function of ToString() method.

Declaration
public static HashDigest<T> ToHashDigest<T>(this string hexDigest)
    where T : HashAlgorithm
Parameters
Type Name Description
System.String hexDigest

A hexadecimal representation of a HashDigest<T>.

Returns
Type Description
HashDigest<T>

A corresponding HashDigest<T> value.

Type Parameters
Name Description
T

A System.Security.Cryptography.HashAlgorithm which corresponds to a digest.

Exceptions
Type Condition
System.ArgumentNullException

Thrown when the given hexDigest is null.

System.ArgumentOutOfRangeException

Thrown when the given hexDigest's length is not the double of the Size, the hash algorithm (i.e., T requires.

See Also
FromString(String)
ToString()
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium