aboutsummaryrefslogtreecommitdiffstats
path: root/lib/random
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/securerandom] Add support for UUID version 7nick evans2023-09-191-0/+119
| | | | | | | | | | | | | | | | | | | | | | | Although the specification for UUIDv7 is still in draft, the UUIDv7 algorithm has been relatively stable as it progresses to completion. Version 7 UUIDs can be very useful, because they are lexographically sortable, which can improve e.g: database index locality. See section 6.10 of the draft specification for further explanation: https://datatracker.ietf.org/doc/draft-ietf-uuidrev-rfc4122bis/ The specification allows up to 12 bits of extra timestamp precision, to make UUID generation closer to monotonically increasing. This provides between 1ms and ~240ns of timestamp precision. At the cost of some code complexity and a small performance penalty, a kwarg may specify any arbitrary precision between 0 and 12 extra bits. Any stronger guarantees of monotonicity have considerably larger tradeoffs, so nothing more is implemented. This limitation is documented. Ruby issue: https://bugs.ruby-lang.org/issues/19735 https://github.com/ruby/securerandom/commit/34ed1a2ec3
* Fix code example doc for Random.alphanumericPetrik2023-08-291-1/+1
|
* [Feature #18183] Add `chars:` option to `Random#alphanumeric`Nobuyoshi Nakada2023-08-291-3/+10
|
* [DOC] Improve Random::Formatter docszverok2022-12-111-17/+45
| | | | | | | * Make its usage more obvious (by providing more detailed examples); * Include mention of it into Random itself; * Small cleanups of docs.
* [ruby/securerandom] Use String#unpack1Nobuyoshi Nakada2021-12-141-1/+1
| | | | https://github.com/ruby/securerandom/commit/5460a18c35
* [DOC] Fix a type [ci skip]Nobuyoshi Nakada2021-12-141-1/+1
|
* [DOC] Improve Random::Formatter description and exampleNobuyoshi Nakada2021-12-131-0/+2
|
* [ruby/securerandom] Split Random::Formatter from SecureRandom [Feature #18190]Nobuyoshi Nakada2021-12-091-0/+215
https://github.com/ruby/securerandom/commit/1e57277b9e