MCPcopy
hub / github.com/google/uuid / NewDCESecurity

Function NewDCESecurity

dce.go:32–40  ·  view source on GitHub ↗

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 users UID for the Person domain and the users GID for the Group. The meaning of id for the domain Org or on non-POSIX systems is site defined. For a giv

(domain Domain, id uint32)

Source from the content-addressed store, hash-verified

30// For a given domain/id pair the same token may be returned for up to
31// 7 minutes and 10 seconds.
32func NewDCESecurity(domain Domain, id uint32) (UUID, error) {
33 uuid, err := NewUUID()
34 if err == nil {
35 uuid[6] = (uuid[6] & 0x0f) | 0x20 // Version 2
36 uuid[9] = byte(domain)
37 binary.BigEndian.PutUint32(uuid[0:], id)
38 }
39 return uuid, err
40}
41
42// NewDCEPerson returns a DCE Security (Version 2) UUID in the person
43// domain with the id returned by os.Getuid.

Callers 3

NewDCEPersonFunction · 0.85
NewDCEGroupFunction · 0.85
TestDCEFunction · 0.85

Calls 1

NewUUIDFunction · 0.85

Tested by 1

TestDCEFunction · 0.68