Source File
util.go
Belonging Package
crypto/rand
package rand
import (
)
var smallPrimes = []uint8{
3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53,
}
var smallPrimesProduct = new(big.Int).SetUint64(16294579238595022365)
if >= 2 {
[0] |= 3 << ( - 2)
[0] |= 1
if len() > 1 {
[1] |= 0x80
}
.Mod(, smallPrimesProduct)
:= .Uint64()
:
for := uint64(0); < 1<<20; += 2 {
:= +
for , := range smallPrimes {
if %uint64() == 0 && ( > 6 || != uint64()) {
continue
}
}
if > 0 {
.SetUint64()
.Add(, )
}
break
}
if .ProbablyPrime(20) && .BitLen() == {
return
}
}
}
:= .BitLen()
return
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |