Show / Hide Table of Contents

Class HashAlgorithmTable

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

Methods

| Improve this Doc View Source

ToHashAlgorithmGetter(IEnumerable<KeyValuePair<Int64, HashAlgorithmType>>)

Creates a HashAlgorithmGetter delegate from a table.

Declaration
public static HashAlgorithmGetter ToHashAlgorithmGetter(this IEnumerable<KeyValuePair<long, HashAlgorithmType>> table)
Parameters
Type Name Description
IEnumerable<KeyValuePair<Int64, HashAlgorithmType>> table

A table with block index offsets and their corresponding HashAlgorithmType. For example, 0: SHA1, 10: SHA256, 100: SHA512 means i => i >= 100 ? HashAlgorithmType.Of<SHA512>() : i >= 10 ? HashAlgorithmType.Of<SHA256>() : HashAlgorithmType.Of<SHA1>(). (Note that 0 means otherwise.) It must contain at least one entry with index 0, because it is the last fallback.

Returns
Type Description
HashAlgorithmGetter

A corresponding HashAlgorithmGetter.

Exceptions
Type Condition
ArgumentException

Thrown when table has no the last fallback entry with index 0, or there are entries with duplicate indices.

  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2021 Planetarium