Documentation ¶
Overview ¶
Package guoid provides cryptographically secure unique identifiers of type string and type []byte.
On Linux, FreeBSD, Dragonfly and Solaris, getrandom(2) is used if available, /dev/urandom otherwise. On OpenBSD and macOS, getentropy(2) is used. On other Unix-like systems, /dev/urandom is used. On Windows systems, the RtlGenRandom API is used. On Wasm, the Web Crypto API is used.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Cryptographically secure charsets should include N characters, // where N is a factor of 256 (2, 4, 8, 16, 32, 64, 128, 256) Secure32Char = []byte("abcdefghijklmnopqrstuvwxyz012345") Secure64Char = []byte("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-") )
Charsets for string gouids.
Functions ¶
Types ¶
type GOUID ¶ added in v0.0.3
type GOUID []byte
GOUID is a byte slice.
func (GOUID) MarshalJSON ¶ added in v0.0.3
MarshalJSON hex encodes the gouid.
func (*GOUID) UnmarshalJSON ¶ added in v0.0.3
UnmarshalJSON decodes a hex encoded string into a gouid.
Click to show internal directories.
Click to hide internal directories.