random

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 26, 2024 License: Apache-2.0, MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addrs

func Addrs(n int) []string

Addrs returns a slice of n random unique addresses.

func BlocksOfSize added in v0.0.3

func BlocksOfSize(n int, size int) []blocks.Block

BlocksOfSize generates a slice of blocks of the specified byte size.

func Bytes added in v0.0.3

func Bytes(n int) []byte

Bytes returns a byte array of the given size with random values.

func Cids

func Cids(n int) []cid.Cid

Cids returns a slice of n random unique CIDs.

func HttpMultiaddrs added in v0.0.3

func HttpMultiaddrs(n int) []multiaddr.Multiaddr

HttpMultiaddrs returns a slice of n random unique Multiaddrs.

func Identity

func Identity() (peer.ID, crypto.PrivKey, crypto.PubKey)

Identity returns a random unique peer ID, private key, and public key.

func Multiaddrs

func Multiaddrs(n int) []multiaddr.Multiaddr

Multiaddrs returns a slice of n random unique Multiaddrs.

func Multihashes

func Multihashes(n int) []multihash.Multihash

Multihashes returns a slice of n random unique Multihashes.

func Peers added in v0.0.3

func Peers(n int) []peer.ID

Peers returns a slice fo n random peer IDs.

func Seed added in v0.0.3

func Seed() int64

Returns the initial seed used for the pseudo-random number generator. Calling SetSeed(Seed()) each time before generating random items will cause items with the same values to be generated.

func SetSeed added in v0.0.3

func SetSeed(seed int64)

Sets the seed for the pseudo-random number generator

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL