1
0
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.
Go to file
Bryan Matsuo 1c7b0fea16 opitimize json interface methods
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).
2015-10-10 22:08:33 -07:00
CONTRIBUTORS uuid: source re-organization 2011-08-08 14:34:29 -07:00
dce.go Move code up one directory 2015-06-03 14:39:07 -07:00
doc.go Move code up one directory 2015-06-03 14:39:07 -07:00
hash.go Move code up one directory 2015-06-03 14:39:07 -07:00
json_test.go benchmarks for Parse(), New(), String(), URN(), MarshalJSON, UnmarshalJSON() 2015-10-10 21:12:07 -07:00
json.go opitimize json interface methods 2015-10-10 22:08:33 -07:00
LICENSE Move code up one directory 2015-06-03 14:39:07 -07:00
node.go Move code up one directory 2015-06-03 14:39:07 -07:00
seq_test.go Move code up one directory 2015-06-03 14:39:07 -07:00
sql_test.go Implement database/sql's Scanner interface. Fixes #5 2015-08-24 16:47:56 -04:00
sql.go Implement database/sql's Scanner interface. Fixes #5 2015-08-24 16:47:56 -04:00
time.go Move code up one directory 2015-06-03 14:39:07 -07:00
util.go use arrays in Parse() for reduced allocation cost and bounds checks 2015-10-10 21:12:40 -07:00
uuid_test.go benchmarks for Parse(), New(), String(), URN(), MarshalJSON, UnmarshalJSON() 2015-10-10 21:12:07 -07:00
uuid.go opitimize json interface methods 2015-10-10 22:08:33 -07:00
version1.go Move code up one directory 2015-06-03 14:39:07 -07:00
version4.go Move code up one directory 2015-06-03 14:39:07 -07:00