Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/awnumar/fastrand
/ functions
Functions
50 in github.com/awnumar/fastrand
⨍
Functions
50
◇
Types & classes
1
↓ 13 callers
Method
Read
Read fills b with random data. It always returns len(b), nil.
fastrand.go:50
↓ 11 callers
Function
Read
Read is a helper function that calls Reader.Read on b. It always fills b completely.
fastrand.go:117
↓ 9 callers
Function
Intn
Intn returns a uniform random int in [0,n). It panics if n <= 0.
fastrand.go:147
↓ 8 callers
Function
panics
panics returns true if the function fn panicked.
fastrand_test.go:17
↓ 6 callers
Function
BigIntn
BigIntn returns a uniform random *big.Int in [0,n). It panics if n <= 0.
fastrand.go:158
↓ 6 callers
Function
Uint64n
Uint64n returns a uniform random uint64 in [0,n). It panics if n == 0.
fastrand.go:127
↓ 4 callers
Function
Perm
Perm returns a random permutation of the integers [0,n).
fastrand.go:164
↓ 3 callers
Function
Shuffle
Shuffle randomizes the order of elements. n is the number of elements. It panics if n < 0. swap swaps the elements with indexes i and j.
fastrand.go:176
↓ 2 callers
Function
Bytes
Bytes is a helper function that returns n bytes of random data.
fastrand.go:120
Function
BenchmarkBigCryptoInt
BenchmarkBigCryptoInt benchmarks the (crypto/rand).Int function for small ints.
fastrand_test.go:333
Function
BenchmarkBigCryptoIntLarge
BenchmarkBigCryptoIntLarge benchmarks the (crypto/rand).Int function for large ints.
fastrand_test.go:341
Function
BenchmarkBigIntn
BenchmarkBigIntn benchmarks the BigIntn function for small ints.
fastrand_test.go:315
Function
BenchmarkBigIntnLarge
BenchmarkBigIntnLarge benchmarks the BigIntn function for large ints.
fastrand_test.go:323
Function
BenchmarkIntn
BenchmarkIntn benchmarks the Intn function for small ints.
fastrand_test.go:298
Function
BenchmarkIntnLarge
BenchmarkIntnLarge benchmarks the Intn function for large ints.
fastrand_test.go:306
Function
BenchmarkPerm32
BenchmarkPerm benchmarks the speed of Perm for small slices.
fastrand_test.go:351
Function
BenchmarkPermLarge4k
BenchmarkPermLarge benchmarks the speed of Perm for large slices.
fastrand_test.go:359
Function
BenchmarkRead32
BenchmarkRead benchmarks the speed of Read for small slices.
fastrand_test.go:385
Function
BenchmarkRead4Threads32
BenchmarkRead4Threads32 benchmarks the speed of Read when it's being using across four threads.
fastrand_test.go:406
Function
BenchmarkRead4Threads512kb
BenchmarkRead4Threads512kb benchmarks the speed of Read when it's being using across four threads with 512kb read sizes.
fastrand_test.go:432
Function
BenchmarkRead512kb
BenchmarkRead512kb benchmarks the speed of Read for larger slices.
fastrand_test.go:395
Function
BenchmarkRead64Threads32
BenchmarkRead64Threads32 benchmarks the speed of Read when it's being using across 64 threads.
fastrand_test.go:458
Function
BenchmarkRead64Threads512kb
BenchmarkRead64Threads512kb benchmarks the speed of Read when it's being using across 64 threads with 512kb read sizes.
fastrand_test.go:484
Function
BenchmarkReadCrypto32
BenchmarkReadCrypto benchmarks the speed of (crypto/rand).Read for small slices. This establishes a lower limit for BenchmarkRead32.
fastrand_test.go:510
Function
BenchmarkReadCrypto4Threads32
BenchmarkReadCrypto4Threads32 benchmarks the speed of rand.Read when its being used across 4 threads with 32 byte read sizes.
fastrand_test.go:532
Function
BenchmarkReadCrypto4Threads512kb
BenchmarkReadCrypto4Threads512kb benchmarks the speed of rand.Read when its being used across 4 threads with 512 kb read sizes.
fastrand_test.go:561
Function
BenchmarkReadCrypto512kb
BenchmarkReadCrypto512kb benchmarks the speed of (crypto/rand).Read for larger slices. This establishes a lower limit for BenchmarkRead512kb.
fastrand_test.go:521
Function
BenchmarkReadCrypto64Threads32
BenchmarkReadCrypto64Threads32 benchmarks the speed of rand.Read when its being used across 4 threads with 32 byte read sizes.
fastrand_test.go:590
Function
BenchmarkReadCrypto64Threads512kb
BenchmarkReadCrypto64Threads512k benchmarks the speed of rand.Read when its being used across 4 threads with 512 kb read sizes.
fastrand_test.go:619
Function
BenchmarkReadMath32
BenchmarkReadMath benchmarks the speed of (math/rand).Read for small slices. This establishes an upper limit for BenchmarkRead32.
fastrand_test.go:648
Function
BenchmarkReadMath4Threads32
BenchmarkReadMath4Threads32 benchmarks the speed of ReadMath when it's being using across four threads.
fastrand_test.go:670
Function
BenchmarkReadMath4Threads512kb
BenchmarkReadMath4Threads512kb benchmarks the speed of ReadMath when it's being using across four threads with 512kb read sizes.
fastrand_test.go:696
Function
BenchmarkReadMath512kb
BenchmarkReadMath512kb benchmarks the speed of (math/rand).Read for larger slices. This establishes an upper limit for BenchmarkRead512kb.
fastrand_test.go:659
Function
BenchmarkReadMath64Threads32
BenchmarkReadMath64Threads32 benchmarks the speed of ReadMath when it's being using across 64 threads.
fastrand_test.go:722
Function
BenchmarkReadMath64Threads512kb
BenchmarkReadMath64Threads512kb benchmarks the speed of ReadMath when it's being using across 64 threads with 512kb read sizes.
fastrand_test.go:748
Function
BenchmarkShuffle32
BenchmarkShuffle benchmarks the speed of Shuffle for small slices.
fastrand_test.go:367
Function
BenchmarkShuffleLarge4k
BenchmarkShuffleLarge benchmarks the speed of Shuffle for large slices.
fastrand_test.go:376
Function
BenchmarkUint64n
BenchmarkUint64n benchmarks the Uint64n function for small uint64s.
fastrand_test.go:281
Function
BenchmarkUint64nLarge
BenchmarkUint64nLarge benchmarks the Uint64n function for large uint64s.
fastrand_test.go:289
Function
TestBigIntnPanics
TestBigIntnPanics tests that BigIntn panics if n <= 0.
fastrand_test.go:57
Function
TestIntn
TestIntn tests the Intn function.
fastrand_test.go:91
Function
TestIntnPanics
TestIntnPanics tests that Intn panics if n <= 0.
fastrand_test.go:39
Function
TestPerm
TestPerm tests the Perm function.
fastrand_test.go:233
Function
TestRandConcurrent
TestRandConcurrent checks that there are no race conditions when using the rngs concurrently.
fastrand_test.go:185
Function
TestRead
TestRead tests that Read produces output with sufficiently high entropy.
fastrand_test.go:107
Function
TestReadConcurrent
TestReadConcurrent tests that concurrent calls to 'Read' will not result result in identical entropy being produced. Note that for this test to work,
fastrand_test.go:131
Function
TestShuffle
TestShuffle tests the Shuffle function.
fastrand_test.go:258
Function
TestUint64n
TestUint64n tests the Uint64n function.
fastrand_test.go:75
Function
TestUint64nPanics
TestUint64nPanics tests that Uint64n panics if n == 0.
fastrand_test.go:26
Function
init
init provides the initial entropy for the reader that will seed all numbers coming out of fastrand.
fastrand.go:43