• Design
  • API Reference
  • Changelog
  • Contribute
Show / Hide Table of Contents
  • Libplanet
    • Address
    • AddressExtension
    • ByteUtil
    • Hashcash
    • Hashcash.Stamp
    • HashDigest<T>
    • HashDigestExtension
    • Nonce
  • Libplanet.Action
    • AccountStateGetter
    • ActionEvaluation<T>
    • ActionTypeAttribute
    • AddressStateMap
    • IAccountStateDelta
    • IAction
    • IActionContext
    • IRandom
    • MissingActionTypeException
    • PolymorphicAction<T>
  • Libplanet.Blockchain
    • BlockChain<T>
  • Libplanet.Blockchain.Policies
    • BlockPolicy<T>
    • BlockPolicyExtension
    • IBlockPolicy<T>
  • Libplanet.Blocks
    • Block<T>
    • InvalidBlockDifficultyException
    • InvalidBlockException
    • InvalidBlockHashException
    • InvalidBlockIndexException
    • InvalidBlockNonceException
    • InvalidBlockPreviousHashException
    • InvalidBlockTimestampException
  • Libplanet.Crypto
    • InvalidCiphertextException
    • PrivateKey
    • PublicKey
    • SymmetricKey
  • Libplanet.Net
    • BlockDownloadState
    • DifferentAppProtocolVersionException
    • DifferentProtocolVersionEventArgs
    • IceServer
    • IceServerException
    • InvalidMessageException
    • NoSwarmContextException
    • Peer
    • PeerNotFoundException
    • PeerSetDelta
    • Swarm
    • SwarmException
  • Libplanet.Serialization
    • BencodexFormatter<T>
    • SerializationInfoExtension
  • Libplanet.Store
    • BaseIndex<TKey, TVal>
    • BaseStore
    • BlockSet<T>
    • FileStore
    • IStore
    • NamespaceNotFoundException
    • TransactionSet<T>
  • Libplanet.Tx
    • InvalidTxException
    • InvalidTxIdException
    • InvalidTxNonceException
    • InvalidTxPublicKeyException
    • InvalidTxSignatureException
    • InvalidTxUpdatedAddressesException
    • Transaction<T>
    • TxId
    • UnexpectedlyTerminatedTxRehearsalException

Class Hashcash

This contains a set of functions that implements Hashcash, a proof-of-work system.

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

Methods

| Improve this Doc View Source

Answer(Hashcash.Stamp, Int64)

Finds a Nonce that satisfies the given difficulty. This process is so-called “mining”.

Declaration
public static Nonce Answer(Hashcash.Stamp stamp, long 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.

Int64 difficulty

A number to calculate the target number for which the returned answer should be less than.

Returns
Type Description
Nonce

A Nonce value which satisfies the given difficulty.

See Also
Hashcash.Stamp
| Improve this Doc View Source

Hash(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 bytes.

  • Improve this Doc
  • View Source
Back to top Copyright © 2019 Planetarium
Generated by DocFX