Class Hashcash
This contains a set of functions that implements Hashcash, a proof-of-work system.
Inherited Members
Namespace: Libplanet
Assembly: Libplanet.dll
Syntax
public static class Hashcash
Methods
| Improve this Doc View SourceAnswer(Hashcash.Stamp, Int32)
Declaration
public static Nonce Answer(Hashcash.Stamp stamp, int difficulty)
Parameters
Type | Name | Description |
---|---|---|
Hashcash.Stamp | stamp | A callback to get a “stamp” which is a Byte array determined from a given Nonce value. |
Int32 | difficulty | The minimum required number of leading zero bits that a returned answer needs to have. |
Returns
Type | Description |
---|---|
Nonce | A Nonce value which satisfies the given
|
See Also
| Improve this Doc View SourceHash(Byte[])
Calculates a SHA-256 digest from the given bytes
.
Declaration
public static HashDigest<SHA256> Hash(byte[] bytes)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | bytes | A Byte array to calculate its hash digest. |
Returns
Type | Description |
---|---|
HashDigest<SHA256> | A deterministic digest of the given
|