Skip to content

Tags: rs/xid

Tags

v1.5.0

Toggle v1.5.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Generate machine ID using SHA-256 to avoid FIPS compliance issues (#94)

While object ID generation doesn't rely on the cryptographic security of MD5,
many FIPS environments block the use of MD5 entirely. Mongo has also moved
away from MD5 in their implementations of object ID generation for the same
reason [1]. They initially replaced MD5 with FNV-1a, but the C driver at
least has since moved from FNV-1a to SipHash.

In any case, the machine ID is generated only once during initialization in
this code, so the speed of the chosen hash function is not important.

[1] https://jira.mongodb.org/browse/DRIVERS-492

v1.4.0

Toggle v1.4.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
From string validation (#75)

* chore: address linter issues

Perform changes suggested by linter; no functional changes.

* error.go: make ErrInvalidID a const

Make ErrInvalidID a constant instead of a variable. This prevent it from
being changed by external packages; a behavior that although allowed by 
the compiler, should probably be considered an invalid operation.

* add benchmark and new failing test for FromString

* fix: let decode look for additional base32 padding

Update FromString and XID.TextUnmarshal so that it looks for discarded
bits in the final source character. This ensures that XIDs that have
been manually tampered with in a way that's ignored by base32 decode,
will not pass as valid.

v1.3.0

Toggle v1.3.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Try /etc/machine-id for linux first (#60)

v1.2.1

Toggle v1.2.1's commit message
Use syscall instead of x/sys/* (#41)

v1.2.0

Toggle v1.2.0's commit message
Remove dep on testify

v1.1.0

Toggle v1.1.0's commit message
Add go.mod file (#35)

v1.1

Toggle v1.1's commit message
Optimize FromString by x100 by unrolling the stdlib algorithm loop

v1.0

Toggle v1.0's commit message
Add FromString method