Commit Graph

11 Commits

Author SHA1 Message Date
b28e506295 docs(readme): fix typo Shuffle code example 2025-03-10 23:52:37 +00:00
a141938394 feat(shuffle)!: add Shuffle and ShuffleSlice functions (#11)
Add equivalent to `Shuffle` function from `math/rand` and `math/rand/v2`
packages, but based on randomness from `crypto/rand` package. This
allows cryptographically secure shuffling of data.

Also add `ShuffleSlice` function that shuffles a slice of any type.

BREAKING CHANGE: Minimum required Go version is now 1.18 due the `ShuffleSlice` using generics.
2025-03-10 23:50:25 +00:00
fe4308607c feat(strings/uuidv7): add UUIDv7 generation (#10)
The UUID v7 format is a time-ordered random UUID. It uses a timestamp
with millisecond precision in the most significant bits, followed by
random data. This provides both uniqueness and chronological ordering,
making it ideal for database primary keys and situations where sorting
by creation time is desired.

References:
- https://uuid7.com/
- https://www.ietf.org/archive/id/draft-peabody-dispatch-new-uuid-format-04.html#name-uuid-version-7
2025-02-28 02:16:32 +00:00
e87d9c4726 docs(readme): fix badges (#9) 2025-02-28 01:31:43 +00:00
1b0bb32a3e docs(readme): fix links to randsmust package 2021-12-17 12:51:54 +00:00
22fe517baa feat(randsmust): add randsmust package
randsmust is specifically intended as an alternative to rands for use in
tests. All functions return a single value, and panic in the event of an
error. This makes them easy to use when building structs in test cases
that need random data.

Internally the package simply calls the equivalent function from the
rands package, and panics if a error is returned.
2021-12-17 11:03:32 +00:00
74dd8fb7e9 docs(examples): add error handling to examples 2021-12-17 01:48:41 +00:00
09883ed0d2 docs(readme): add UUID() example to readme 2021-03-16 02:25:50 +00:00
f13952d55e docs(readme): fix formatting issue 2021-01-20 03:14:20 +00:00
597fe535d3 feat(rands): initial implementation 2021-01-20 02:58:03 +00:00
3ddcfd415c chore: initial commit 2021-01-20 02:55:16 +00:00