~samwhited/xmpp

1d0538ce801c7ffb4ca39eeff9868141d6331326 — Sam Whited 5 years ago 592e409
Replace custom cryptoReader with rand.Reader
1 files changed, 1 insertions(+), 7 deletions(-)

M internal/idgen.go
M internal/idgen.go => internal/idgen.go +1 -7
@@ 21,7 21,7 @@ const IDLen = 16
// entropy pool isn't initialized, or we can't generate random numbers for some
// other reason, panic.
func RandomID(n int) string {
	return randomID(n, cryptoReader{})
	return randomID(n, rand.Reader)
}

func randomID(n int, r io.Reader) string {


@@ 35,9 35,3 @@ func randomID(n int, r io.Reader) string {

	return fmt.Sprintf("%x", b)[:n]
}

type cryptoReader struct{}

func (cryptoReader) Read(p []byte) (int, error) {
	return rand.Read(p)
}