• Overview
  • 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
    • ActionTypeAttribute
    • IAccountStateDelta
    • IAction
    • IActionContext
    • IRandom
    • MissingActionTypeException
    • PolymorphicAction<T>
    • RandomExtension
    • UnexpectedlyTerminatedActionException
  • Libplanet.Blockchain
    • BlockChain<T>
    • BlockChain<T>.TipChangedEventArgs
    • IncompleteBlockStatesException
    • MineBlockEventArgs<T>
  • Libplanet.Blockchain.Policies
    • BlockPolicy<T>
    • IBlockPolicy<T>
  • Libplanet.Blocks
    • Block<T>
    • InvalidBlockDifficultyException
    • InvalidBlockException
    • InvalidBlockHashException
    • InvalidBlockIndexException
    • InvalidBlockNonceException
    • InvalidBlockPreviousHashException
    • InvalidBlockTimestampException
    • InvalidGenesisBlockException
  • Libplanet.Crypto
    • CryptoConfig
    • DefaultCryptoBackend
    • ICryptoBackend
    • InvalidCiphertextException
    • PrivateKey
    • PublicKey
    • SymmetricKey
  • Libplanet.KeyStore
    • IncorrectPassphraseException
    • InvalidKeyJsonException
    • KeyJsonException
    • MismatchedAddressException
    • ProtectedPrivateKey
    • UnsupportedKeyJsonException
  • Libplanet.KeyStore.Ciphers
    • Aes128Ctr
    • ICipher
  • Libplanet.KeyStore.Kdfs
    • IKdf
    • Pbkdf2<T>
    • Scrypt
  • Libplanet.Net
    • ActionExecutionState
    • BlockDownloadState
    • BoundPeer
    • DifferentAppProtocolVersionException
    • DifferentProtocolVersionEventArgs
    • IceServer
    • IceServerException
    • InvalidMessageException
    • NoSwarmContextException
    • Peer
    • PeerNotFoundException
    • PeerState
    • PreloadBlockDownloadFailEventArgs
    • PreloadState
    • StateDownloadState
    • Swarm<T>
    • SwarmException
  • Libplanet.Net.Protocols
    • PeerDiscoveryException
  • Libplanet.Serialization
    • SerializationInfoExtension
  • Libplanet.Store
    • BaseIndex<TKey, TVal>
    • BaseStore
    • BlockSet<T>
    • ChainIdNotFoundException
    • DefaultStore
    • IStore
    • StoreExtension
    • TransactionSet<T>
  • Libplanet.Tx
    • InvalidTxException
    • InvalidTxIdException
    • InvalidTxNonceException
    • InvalidTxPublicKeyException
    • InvalidTxSignatureException
    • InvalidTxUpdatedAddressesException
    • Transaction<T>
    • TxId

Class ByteUtil

Utility methods to deal with arrays.

Inheritance
Object
ByteUtil
Namespace: Libplanet
Assembly: Libplanet.dll
Syntax
public static class ByteUtil : object

Methods

| Improve this Doc View Source

CalculateHashCode(Byte[])

Calculates a deterministic hash code from a given bytes. It is mostly used to implement method.

Declaration
public static int CalculateHashCode(byte[] bytes)
Parameters
Type Name Description
Byte[] bytes

A array, which completely determines (or encodes) an object, to calculate a hash code.

Returns
Type Description
Int32

A hash code determined from the given bytes. For equivalent bytes, the same hash code is returned. It must not be null.

| Improve this Doc View Source

Hex(ImmutableArray<Byte>)

Renders a hexadecimal string from a array.

Declaration
public static string Hex(in ImmutableArray<byte> bytes)
Parameters
Type Name Description
ImmutableArray<Byte> bytes

A array to renders the corresponding hexadecimal string. It must not be null.

Returns
Type Description
String

A hexadecimal string which encodes the given bytes.

| Improve this Doc View Source

Hex(Byte[])

Renders a hexadecimal string from a array.

Declaration
public static string Hex(byte[] bytes)
Parameters
Type Name Description
Byte[] bytes

A array to renders the corresponding hexadecimal string. It must not be null.

Returns
Type Description
String

A hexadecimal string which encodes the given bytes.

| Improve this Doc View Source

ParseHex(String)

Converts a hexadecimal string to a array.

Declaration
public static byte[] ParseHex(string hex)
Parameters
Type Name Description
String hex

A which encodes s in hexadecimal. Its length must be zero or an even number. It must not be null.

Returns
Type Description
Byte[]

A array that the given hex string represented in hexadecimal. It lengthens the half of the given hex string.

  • Improve this Doc
  • View Source
Back to top Copyright © 2019–2020 Planetarium