Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/google/uuid
/ functions
Functions
148 in github.com/google/uuid
⨍
Functions
148
◇
Types & classes
13
↓ 35 callers
Method
Error
()
uuid.go:57
↓ 21 callers
Function
Parse
Parse decodes s into a UUID or returns an error if it cannot be parsed. Both the standard UUID forms defined in RFC 9562 (xxxxxxxx-xxxx-xxxx-xxxx-xxx
uuid.go:95
↓ 18 callers
Method
String
String returns the string form of uuid, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx , or "" if uuid is invalid.
uuid.go:272
↓ 16 callers
Method
Version
Version returns the version of uuid.
uuid.go:314
↓ 15 callers
Function
MustParse
MustParse is like Parse but panics if the string cannot be parsed. It simplifies safe initialization of global variables holding compiled UUIDs.
uuid.go:194
↓ 12 callers
Function
New
New creates a new random UUID or panics. New is equivalent to the expression uuid.Must(uuid.NewRandom())
version4.go:13
↓ 12 callers
Method
Scan
Scan implements sql.Scanner so UUIDs can be read from databases transparently. Currently, database types that map to string and []byte are supported.
sql.go:15
↓ 11 callers
Method
ClockSequence
ClockSequence returns the clock sequence encoded in uuid. The clock sequence is only well defined for version 1 and 2 UUIDs.
time.go:139
↓ 11 callers
Method
Variant
Variant returns the variant encoded in uuid.
uuid.go:300
↓ 10 callers
Function
SetRand
SetRand sets the random number generator to r, which implements io.Reader. If r.Read returns an error when the package requests random data then a pan
uuid.go:347
↓ 9 callers
Function
NewUUID
NewUUID returns a Version 1 UUID based on the current NodeID and clock sequence, and the current time. If the NodeID has not been set by SetNodeID or
version1.go:19
↓ 7 callers
Function
Must
Must returns uuid if err is nil and panics otherwise.
uuid.go:210
↓ 7 callers
Function
NewRandom
NewRandom returns a Random (Version 4) UUID. The strength of the UUIDs is based on the strength of the crypto/rand package. Uses the randomness pool
version4.go:39
↓ 6 callers
Function
NewV7
UUID version 7 features a time-ordered value field derived from the widely implemented and well known Unix Epoch timestamp source, the number of milli
version7.go:23
↓ 6 callers
Method
NodeID
NodeID returns the 6 byte node id encoded in uuid. It returns nil if uuid is not valid. The NodeID is only well defined for version 1 and 2 UUIDs.
node.go:86
↓ 6 callers
Method
Time
Time returns the time in 100s of nanoseconds since 15 Oct 1582 encoded in uuid. The time is only defined for version 1, 2, 6 and 7 UUIDs.
time.go:117
↓ 6 callers
Function
xtob
xtob converts hex characters x1 and x2 into a byte.
util.go:40
↓ 5 callers
Function
NewRandomFromReader
NewRandomFromReader returns a UUID based on bytes read from a given io.Reader.
version4.go:47
↓ 5 callers
Function
NodeInterface
NodeInterface returns the name of the interface from which the NodeID was derived. The interface "user" is returned if the NodeID was set by SetNodeI
node.go:21
↓ 5 callers
Function
ParseBytes
ParseBytes is like Parse, except it parses a byte slice instead of a string.
uuid.go:148
↓ 4 callers
Function
EnableRandPool
EnableRandPool enables internal randomness pool used for Random (Version 4) UUID generation. The pool contains random bytes read from the random numbe
uuid.go:366
↓ 4 callers
Method
MarshalText
MarshalText implements encoding.TextMarshaler.
marshal.go:10
↓ 4 callers
Function
NodeID
NodeID returns a slice of a copy of the current Node ID, setting the Node ID if not already set.
node.go:60
↓ 4 callers
Function
SetClockSequence
SetClockSequence sets the clock sequence to the lower 14 bits of seq. Setting to -1 causes a new sequence to be generated.
time.go:96
↓ 4 callers
Function
setNodeInterface
(name string)
node.go:39
↓ 3 callers
Function
DisableRandPool
DisableRandPool disables the randomness pool if it was previously enabled with EnableRandPool. Both EnableRandPool and DisableRandPool are not thread
uuid.go:376
↓ 3 callers
Function
NewDCESecurity
NewDCESecurity returns a DCE Security (Version 2) UUID. The domain should be one of Person, Group or Org. On a POSIX system the id should be the user
dce.go:32
↓ 3 callers
Function
NewV6WithTime
NewV6WithTime returns a Version 6 UUID based on the current NodeID, clock sequence, and a specified time. It is similar to the NewV6 function, but all
version6.go:39
↓ 3 callers
Method
Scan
Scan implements the SQL driver.Scanner interface.
null.go:35
↓ 3 callers
Function
SetNodeInterface
SetNodeInterface selects the hardware address to be used for Version 1 UUIDs. If name is "" then the first usable interface found will be used or a ra
node.go:33
↓ 3 callers
Method
UnixTime
UnixTime converts t the number of seconds and nanoseconds using the Unix epoch of 1 Jan 1970.
time.go:35
↓ 3 callers
Function
encodeHex
(dst []byte, uuid UUID)
uuid.go:287
↓ 3 callers
Function
getTime
(customTime *time.Time)
time.go:51
↓ 3 callers
Function
setClockSequence
(seq int)
time.go:102
↓ 3 callers
Function
testDCE
(t *testing.T, name string, uuid UUID, err error, domain Domain, id uint32)
uuid_test.go:454
↓ 2 callers
Function
FromBytes
FromBytes creates a new UUID from a byte slice. Returns an error if the slice does not have a length of 16. The bytes are copied from the slice.
uuid.go:204
↓ 2 callers
Function
GetTime
GetTime returns the current Time (100s of nanoseconds since 15 Oct 1582) and clock sequence as well as adjusting the clock sequence as needed. An err
time.go:45
↓ 2 callers
Method
MarshalBinary
MarshalBinary implements encoding.BinaryMarshaler.
marshal.go:27
↓ 2 callers
Function
NewHash
NewHash returns a new UUID derived from the hash of space concatenated with data generated by h. The hash should be at least 16 byte in length. The
hash.go:33
↓ 2 callers
Function
NewV6
UUID version 6 is a field-compatible version of UUIDv1, reordered for improved DB locality. It is expected that UUIDv6 will primarily be used in conte
version6.go:24
↓ 2 callers
Function
NewV7FromReader
NewV7FromReader returns a Version 7 UUID based on the current time(Unix Epoch). it use NewRandomFromReader fill random bits. On error, NewV7FromReader
version7.go:35
↓ 2 callers
Function
SetNodeID
SetNodeID sets the Node ID to be used for Version 1 UUIDs. The first 6 bytes of id are used. If id is less than 6 bytes then false is returned and t
node.go:73
↓ 2 callers
Method
URN
URN returns the RFC 2141 URN form of uuid, urn:uuid:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx, or "" if uuid is invalid.
uuid.go:280
↓ 2 callers
Method
Value
Value implements sql.Valuer so that UUIDs can be written to databases transparently. Currently, UUIDs map to strings. Please consult database-specific
sql.go:57
↓ 2 callers
Method
Value
Value implements the driver Valuer interface.
null.go:52
↓ 2 callers
Function
generateV6
(now Time, seq uint16)
version6.go:48
↓ 2 callers
Function
makeV7
makeV7 fill 48 bits time (uuid[0] - uuid[5]), set version b0111 (uuid[6]) uuid[8] already has the right version number (Variant is 10) see function Ne
version7.go:48
↓ 2 callers
Function
randomBits
randomBits completely fills slice b with random data.
util.go:13
↓ 2 callers
Function
testTest
(t *testing.T, in string, tt test)
uuid_test.go:98
↓ 1 callers
Function
Compare
Compare returns an integer comparing two uuids lexicographically. The result will be 0 if a == b, -1 if a < b, and +1 if a > b.
util.go:47
↓ 1 callers
Method
Domain
Domain returns the domain for a Version 2 UUID. Domains are only defined for Version 2 UUIDs.
dce.go:60
↓ 1 callers
Method
ID
ID returns the id for a Version 2 UUID. IDs are only defined for Version 2 UUIDs.
dce.go:66
↓ 1 callers
Method
Is
(target error)
uuid.go:61
↓ 1 callers
Function
IsInvalidLengthError
IsInvalidLengthError is matcher function for custom error invalidLengthError
uuid.go:82
↓ 1 callers
Function
NewDCEGroup
NewDCEGroup returns a DCE Security (Version 2) UUID in the group domain with the id returned by os.Getgid. NewDCESecurity(Group, uint32(os.Getgid()))
dce.go:54
↓ 1 callers
Function
NewDCEPerson
NewDCEPerson returns a DCE Security (Version 2) UUID in the person domain with the id returned by os.Getuid. NewDCESecurity(Person, uint32(os.Getuid(
dce.go:46
↓ 1 callers
Function
NewMD5
NewMD5 returns a new MD5 (Version 3) UUID based on the supplied name space and data. It is the same as calling: NewHash(md5.New(), space, data, 3)
hash.go:49
↓ 1 callers
Function
NewSHA1
NewSHA1 returns a new SHA1 (Version 5) UUID based on the supplied name space and data. It is the same as calling: NewHash(sha1.New(), space, data, 5
hash.go:57
↓ 1 callers
Method
Strings
Strings returns a string slice containing the string form of each UUID in uuids.
uuid.go:387
↓ 1 callers
Method
UnmarshalBinary
UnmarshalBinary implements encoding.BinaryUnmarshaler.
marshal.go:32
↓ 1 callers
Function
Validate
Validate returns an error if s is not a properly formatted UUID in one of the following formats: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx urn:uuid:xxxxxxx
uuid.go:223
↓ 1 callers
Function
clockSequence
()
time.go:87
↓ 1 callers
Function
contains
(t *testing.T, arr []string, str string)
version6_test.go:81
↓ 1 callers
Function
getHardwareInterface
getHardwareInterface returns nil values for the JS version of the code. This removes the "net" dependency, because it is not used in the browser. Usin
node_js.go:12
↓ 1 callers
Function
getV7Time
getV7Time returns the time in milliseconds and nanoseconds / 256. The returned (milli << 12 + seq) is guaranteed to be greater than (milli << 12 + seq
version7.go:88
↓ 1 callers
Function
newRandomFromPool
()
version4.go:58
↓ 1 callers
Function
parseBytesCopy
parseBytesCopy is to benchmark not using unsafe.
uuid_test.go:673
↓ 1 callers
Function
parseBytesUnsafe
parseBytesUnsafe is to benchmark using unsafe.
uuid_test.go:659
↓ 1 callers
Function
testBytes
(t *testing.T, in []byte, tt test)
uuid_test.go:115
Function
BenchmarkNew
(b *testing.B)
uuid_test.go:686
Function
BenchmarkNewV6WithTime
(b *testing.B)
version6_test.go:69
Function
BenchmarkParse
(b *testing.B)
uuid_test.go:640
Function
BenchmarkParseBadLength
(b *testing.B)
uuid_test.go:716
Function
BenchmarkParseBytes
(b *testing.B)
uuid_test.go:649
Function
BenchmarkParseBytesCopy
(b *testing.B)
uuid_test.go:677
Function
BenchmarkParseBytesUnsafe
(b *testing.B)
uuid_test.go:663
Function
BenchmarkParseLen32Truncated
(b *testing.B)
uuid_test.go:726
Function
BenchmarkParseLen36Corrupted
(b *testing.B)
uuid_test.go:736
Function
BenchmarkUUID_MarshalJSON
(b *testing.B)
json_test.go:85
Function
BenchmarkUUID_New
(b *testing.B)
uuid_test.go:746
Function
BenchmarkUUID_NewPooled
(b *testing.B)
uuid_test.go:757
Function
BenchmarkUUID_String
(b *testing.B)
uuid_test.go:692
Function
BenchmarkUUID_URN
(b *testing.B)
uuid_test.go:704
Function
BenchmarkUUID_UnmarshalJSON
(b *testing.B)
json_test.go:102
Function
BenchmarkUUIDs_Strings
(b *testing.B)
uuid_test.go:769
Function
ClockSequence
ClockSequence returns the current clock sequence, generating one if not already set. The clock sequence is only used for Version 1 UUIDs. The uuid p
time.go:81
Method
Error
()
uuid.go:70
Function
FuzzFromBytes
(f *testing.F)
uuid_test.go:595
Function
FuzzParse
(f *testing.F)
uuid_test.go:576
Function
FuzzParseBytes
(f *testing.F)
uuid_test.go:586
Method
Is
(target error)
uuid.go:74
Method
MarshalBinary
MarshalBinary implements encoding.BinaryMarshaler.
null.go:61
Method
MarshalJSON
MarshalJSON implements json.Marshaler.
null.go:101
Method
MarshalText
MarshalText implements encoding.TextMarshaler.
null.go:80
Function
NewString
NewString creates a new random UUID and returns it as a string or panics. NewString is equivalent to the expression uuid.New().String()
version4.go:21
Method
Read
(buf []byte)
uuid_test.go:482
Method
Read
(bs []byte)
uuid_test.go:902
Method
String
()
dce.go:70
Method
String
()
uuid.go:318
Method
String
()
uuid.go:325
next →
1–100 of 148, ranked by callers