dce.go
func NewDCESecurity(domain Domain, id uint32) (UUID, error) {
	uuid, err := NewUUID()
	if err == nil {
		uuid[6] = (uuid[6] & 0x0f) | 0x20 // Version 2
		uuid[9] = byte(domain)
		binary.BigEndian.PutUint32(uuid[0:], id)
	}
	return uuid, err
}
func NewDCESecurity(domain Domain, id uint32) (UUID, error) {
	uuid, err := NewUUID()
	if err == nil {
		uuid[6] = (uuid[6] & 0x0f) | 0x20 // Version 2
		uuid[9] = byte(domain)
		binary.BigEndian.PutUint32(uuid[0:], id)
	}
	return uuid, err
}
func NewDCESecurity ( domain Domain , id uint32 ) ( UUID , error ) { uuid , err := NewUUID ( ) if err == nil { uuid [ 6 ] = ( uuid [ 6 ] & 0x0f ) | 0x20 // Version 2 uuid [ 9 ] = byte ( domain ) binary . BigEndian . PutUint32 ( uuid [ 0 : ] , id ) } return uuid , err }
// 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 given domain/id pair the same token may be returned for up to
// 7 minutes and 10 seconds.
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 given domain / id pair the same token may be returned for up to 7 minutes and 10 seconds .