File: generatexid.go

package info (click to toggle)
golang-github-d2g-dhcp4client 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 120 kB
  • sloc: makefile: 3
file content (18 lines) | stat: -rw-r--r-- 278 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package dhcp4client

import (
	cryptorand "crypto/rand"
	mathrand "math/rand"
)

func CryptoGenerateXID(b []byte) {
	if _, err := cryptorand.Read(b); err != nil {
		panic(err)
	}
}

func MathGenerateXID(b []byte) {
	if _, err := mathrand.Read(b); err != nil {
		panic(err)
	}
}