mirror of
https://github.com/aykhans/sarin.git
synced 2026-10-17 14:53:52 +00:00
v1.0.0: here we go again
This commit is contained in:
1 parent
25d4762a3c
commit
2d7ba34cb8
68 files changed
+6805
-4548
No files matched your search
@@ -0,0 +1,14 @@
|
||||
package sarin
|
||||
|
||||
import (
|
||||
"math/rand/v2"
|
||||
"time"
|
||||
)
|
||||
|
||||
func NewDefaultRandSource() rand.Source {
|
||||
now := time.Now().UnixNano()
|
||||
return rand.NewPCG(
|
||||
uint64(now), //nolint:gosec // G115: Safe conversion; UnixNano timestamp used as random seed, bit pattern is intentional
|
||||
uint64(now>>32), //nolint:gosec // G115: Safe conversion; right-shifted timestamp for seed entropy, overflow is acceptable
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user