• 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

Interface IRandom

An pseudorandom number generator interface equivalent to .

Although these two types have similar shapes, they are not compatible (i.e., disallowed to be casted to each other).

Namespace: Libplanet.Action
Assembly: Libplanet.dll
Syntax
public interface IRandom

Methods

| Improve this Doc View Source

Next()

Gets a non-negative random integer.

Declaration
int Next()
Returns
Type Description
Int32

A 32-bit signed integer that is greater than or equal to 0 and less than .

| Improve this Doc View Source

Next(Int32)

Gets a non-negative random integer that is less than the specified upperBound.

Declaration
int Next(int upperBound)
Parameters
Type Name Description
Int32 upperBound

The exclusive upper bound of the random number to be generated. It must be greater than or equal to 0.

Returns
Type Description
Int32

A 32-bit signed integer that is greater than or equal to 0 and less than upperBound; that is, the range of return values ordinarily includes 0 but not upperBound. However, if upperBound equals to 0, upperBound is returned.

| Improve this Doc View Source

Next(Int32, Int32)

Gets a random integer that is within a specified range.

Declaration
int Next(int lowerBound, int upperBound)
Parameters
Type Name Description
Int32 lowerBound

The inclusive lower bound of the random number to be generated.

Int32 upperBound

The exclusive upper bound of the random number to be generated. It must be greater than or equal to lowerBound.

Returns
Type Description
Int32

A 32-bit signed integer that is greater than or equal to lowerBound and less than upperBound; that is, the range of return values ordinarily includes lowerBound but not upperBound. If upperBound equals to lowerBound, lowerBound is returned.

| Improve this Doc View Source

NextBytes(Byte[])

Fills the elements of a specified s buffer with random numbers.

Declaration
void NextBytes(byte[] buffer)
Parameters
Type Name Description
Byte[] buffer

A array to contain random numbers.

Extension Methods

RandomExtension.GenerateRandomGuid(IRandom)
  • Improve this Doc
  • View Source
Back to top Copyright © 2019–2020 Planetarium