generatexid.go 278 B

12345678910111213141516171819
  1. package dhcp4client
  2. import (
  3. cryptorand "crypto/rand"
  4. mathrand "math/rand"
  5. )
  6. func CryptoGenerateXID(b []byte) {
  7. if _, err := cryptorand.Read(b); err != nil {
  8. panic(err)
  9. }
  10. }
  11. func MathGenerateXID(b []byte) {
  12. if _, err := mathrand.Read(b); err != nil {
  13. panic(err)
  14. }
  15. }