-
Notifications
You must be signed in to change notification settings - Fork 0
/
docs.go
27 lines (26 loc) · 1.31 KB
/
docs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyrigth 2022 - mailto:seantolstoyevski@protonmail.com
//
// The source codes of this project are licensed under the MIT license.
//
// It is provided without any warranty.
// package crndm (create randoms) is a rdrand and rdseed instruction package.
//
// For more information about rdrand, see: https://en.wikipedia.org/wiki/RDRAND
//
// The intended goal is not to generate a fully featured random package.
// I wanted to create a Golang package that uses CPU instructions to generate random
// numbers and wraps it for simplicity. Rdrand generates random numbers using some
// noise from the CPU (eg silicon noise).
//
// For example, if you want to generate numbers in a range `(Range(0, 100)`, this
// package does not support it. You can implement any random number generation algorithm
// using this package.
//
// `Rdseed` functions may not return true sometimes. These instructions may not work
// under certain conditions as it depends on some hardware features / statuses. Do not
// forget to check the values returned from the functions or the values you pass as a reference.
//
// These intrinsics are already slow in terms of what they do. Additionally, Golang
// **cannot inline assembly**. Do not expect good performance.
// For Golang assembly: https://dave.cheney.net/2019/08/20/go-compiler-intrinsics
package crndm