{"modulePath":"github.com/stackdocker/gogs","version":"v0.8.25","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package uuid\n\nPackage uuid provides implementation of Universally Unique Identifier (UUID). Supported versions are 1, 3, 4 and 5 (as specified in RFC 4122) and version 2 (as specified in DCE 1.1).\n\n## Constants\n\n```go\nconst (\n\tVariantNCS = iota\n\tVariantRFC4122\n\tVariantMicrosoft\n\tVariantFuture\n)\n```\nUUID layout variants.\n\n```go\nconst (\n\tDomainPerson = iota\n\tDomainGroup\n\tDomainOrg\n)\n```\nUUID DCE domains.\n\n## Variables\n\n```go\nvar (\n\tNamespaceDNS, _  = FromString(\"6ba7b810-9dad-11d1-80b4-00c04fd430c8\")\n\tNamespaceURL, _  = FromString(\"6ba7b811-9dad-11d1-80b4-00c04fd430c8\")\n\tNamespaceOID, _  = FromString(\"6ba7b812-9dad-11d1-80b4-00c04fd430c8\")\n\tNamespaceX500, _ = FromString(\"6ba7b814-9dad-11d1-80b4-00c04fd430c8\")\n)\n```\nPredefined namespace UUIDs.\n\n## Functions\n\n```go\nfunc Equal(u1 UUID, u2 UUID) bool\n```\nEqual returns true if u1 and u2 equals, otherwise returns false.\n\n## Types\n\n```go\ntype UUID [16]byte\n```\nUUID representation compliant with specification described in RFC 4122.\n\n```go\nfunc And(u1 UUID, u2 UUID) UUID\n```\nAnd returns result of binary AND of two UUIDs.\n\n```go\nfunc FromBytes(input []byte) (u UUID, err error)\n```\nFromBytes returns UUID converted from raw byte slice input. It will return error if the slice isn't 16 bytes long.\n\n```go\nfunc FromString(input string) (u UUID, err error)\n```\nFromString returns UUID parsed from string input. Following formats are supported: \"6ba7b810-9dad-11d1-80b4-00c04fd430c8\", \"{6ba7b810-9dad-11d1-80b4-00c04fd430c8}\", \"urn:uuid:6ba7b810-9dad-11d1-80b4-00c04fd430c8\"\n\n```go\nfunc NewV1() UUID\n```\nNewV1 returns UUID based on current timestamp and MAC address.\n\n```go\nfunc NewV2(domain byte) UUID\n```\nNewV2 returns DCE Security UUID based on POSIX UID/GID.\n\n```go\nfunc NewV3(ns UUID, name string) UUID\n```\nNewV3 returns UUID based on MD5 hash of namespace UUID and name.\n\n```go\nfunc NewV4() UUID\n```\nNewV4 returns random generated UUID.\n\n```go\nfunc NewV5(ns UUID, name string) UUID\n```\nNewV5 returns UUID based on SHA-1 hash of namespace UUID and name.\n\n```go\nfunc Or(u1 UUID, u2 UUID) UUID\n```\nOr returns result of binary OR of two UUIDs.\n\n```go\nfunc (u UUID) Bytes() []byte\n```\nBytes returns bytes slice representation of UUID.\n\n```go\nfunc (u UUID) MarshalBinary() (data []byte, err error)\n```\nMarshalBinary implements the encoding.BinaryMarshaler interface.\n\n```go\nfunc (u UUID) MarshalText() (text []byte, err error)\n```\nMarshalText implements the encoding.TextMarshaler interface. The encoding is the same as returned by String.\n\n```go\nfunc (u *UUID) SetVariant()\n```\nSetVariant sets variant bits as described in RFC 4122.\n\n```go\nfunc (u *UUID) SetVersion(v byte)\n```\nSetVersion sets version bits.\n\n```go\nfunc (u UUID) String() string\n```\nReturns canonical string representation of UUID: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.\n\n```go\nfunc (u *UUID) UnmarshalBinary(data []byte) error\n```\nUnmarshalBinary implements the encoding.BinaryUnmarshaler interface.\n\n```go\nfunc (u *UUID) UnmarshalText(text []byte) error\n```\nUnmarshalText implements the encoding.TextUnmarshaler interface. UUID is expected in a form accepted by FromString.\n\n```go\nfunc (u UUID) Variant() uint\n```\nVariant returns UUID layout variant.\n\n```go\nfunc (u UUID) Version() uint\n```\nVersion returns algorithm version used to generate UUID.\n\n","path":"github.com/stackdocker/gogs/modules/uuid","name":"uuid","synopsis":"Package uuid provides implementation of Universally Unique Identifier (UUID).","isRedistributable":true}
