mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-10 22:13:39 +00:00
runtime: add runtime.rand function
This function is needed for Go 1.22, and is used from various packages like math/rand. When there is no random number generator available, it falls back to a static sequence of numbers. I think this is fine, because as far as I can see it is only used for non-cryptographic needs.
This commit is contained in:
@@ -308,3 +308,8 @@ func svcOutputDebugString(str *uint8, size uint64) uint64
|
||||
//
|
||||
//export svcGetInfo
|
||||
func svcGetInfo(output *uint64, id0 uint32, handle uint32, id1 uint64) uint64
|
||||
|
||||
func hardwareRand() (n uint64, ok bool) {
|
||||
// TODO: see whether there is a RNG and use it.
|
||||
return 0, false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user