Commit Graph

2 Commits (0207c1913792b605d5250ddac39620785c573abb)

Author SHA1 Message Date
James Tucker 0207c19137
util/rands: add a cheap non-escaping rand type
math/rand and the current v2 proposal retain a source interface that
means they always heap allocate until some future compiler changes this
constraint. This type is one that can be used on-stack for use cases
like a cheap in-place shuffle with an on-stack random generator.

Updates #17243
Signed-off-by: James Tucker <james@tailscale.com>
5 months ago
Brad Fitzpatrick 7175f06e62 util/rands: add package with HexString func
We use it a number of places in different repos. Might as well make
one. Another use is coming.

Updates #cleanup

Change-Id: Ib7ce38de0db35af998171edee81ca875102349a4
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
10 months ago