Class Hashcash
This contains a set of functions that implements Hashcash, a proof-of-work system.
Namespace: Libplanet
Assembly: Libplanet.dll
Syntax
public static class Hashcash : object
Methods
| Improve this Doc View SourceAnswer(Hashcash.Stamp, HashAlgorithmType, Int64, Int32, CancellationToken)
Declaration
public static (Nonce Nonce, ImmutableArray<byte> Digest) Answer(Hashcash.Stamp stamp, HashAlgorithmType hashAlgorithmType, long difficulty, int seed, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
Hashcash.Stamp | stamp | A callback to get a “stamp”
which is a |
HashAlgorithmType | hashAlgorithmType | The hash algorithm to use. |
Int64 | difficulty | A number to calculate the target number for which the returned answer should be less than. |
Int32 | seed | The seed number for random generator. |
CancellationToken | cancellationToken | A cancellation token used to propagate notification that this operation should be canceled. |
Returns
Type | Description |
---|---|
(, )<Nonce, ImmutableArray<Byte>> | A pair of Nonce value which satisfies the
given |