mirror of
https://github.com/google/uuid.git
synced 2024-11-24 08:32:23 +02:00
Go package for UUIDs based on RFC 4122 and DCE 1.1: Authentication and Security Services.
1c7b0fea16
A common helper function is used for UUID.String(), UUID.URN(), and UUID.MarshalJSON(). Any perforance hit in UUID.String() and UUID.Marshal() appears to be negligable. The benefit to UUID.MarshalJSON() is several hundred nanoseconds (23% faster) and 2 allocations (21% fewer bytes). Some redundant checks are removed from UUID.UnmarshalJSON() method. The "encoding/json".Unmarshaler interface specifies that implementations can assume input is valid JSON content. This allows one to assume that (1) input is not empty and (2) if index 0 is a quote, then the content is a json string and the last index will contain a terminating quote. The second point is not completely explicit in the documentation but it is true in practice (and it is safe to assume -- errors will be caught). |
||
---|---|---|
CONTRIBUTORS | ||
dce.go | ||
doc.go | ||
hash.go | ||
json_test.go | ||
json.go | ||
LICENSE | ||
node.go | ||
seq_test.go | ||
sql_test.go | ||
sql.go | ||
time.go | ||
util.go | ||
uuid_test.go | ||
uuid.go | ||
version1.go | ||
version4.go |