ruby / ruby/securerandom

Missing `#uuid_v4` and `#uuid_v7` methods

Open
#37 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
76
Forks
17
Avg merge
11h 32m
Merged PRs (30d)
1

Description

#36 added back #alphanumeric keyword arg for characters. But #uuid_v7 (and the #uuid_v4 alias) are still missing:

With ruby 3.2.6 and securerandom 0.3.2:

$ rbenv shell 3.2.6
$ gem install securerandom -v0.3.2
Fetching securerandom-0.3.2.gem
Successfully installed securerandom-0.3.2
Parsing documentation for securerandom-0.3.2
Installing ri documentation for securerandom-0.3.2
Done installing documentation for securerandom after 0 seconds
1 gem installed
$ ruby -rsecurerandom -e "puts SecureRandom.uuid_v7; puts SecureRandom.uuid_v4"
0193e518-54a6-7e66-ab61-99adfce68788
fb00fada-2414-4f60-8c54-97d30f22f536

With ruby 3.2.6 and securerandom 0.4.1:

$ rbenv shell 3.2.6
$ gem install securerandom -v0.4.1
Fetching securerandom-0.4.1.gem
Successfully installed securerandom-0.4.1
Parsing documentation for securerandom-0.4.1
Installing ri documentation for securerandom-0.4.1
Done installing documentation for securerandom after 0 seconds
1 gem installed
$ ruby -rsecurerandom -e "puts SecureRandom.uuid_v7"
-e:1:in `<main>': undefined method `uuid_v7' for SecureRandom:Module (NoMethodError)

puts SecureRandom.uuid_v7
                 ^^^^^^^^
Did you mean?  uuid
$ ruby -rsecurerandom -e "puts SecureRandom.uuid_v4"
-e:1:in `<main>': undefined method `uuid_v4' for SecureRandom:Module (NoMethodError)

puts SecureRandom.uuid_v4
                 ^^^^^^^^
Did you mean?  uuid

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the SecureRandom API around the existing uuid method and compare the behavior shown for versions 0.3.2 and 0.4.1. Verify that SecureRandom.uuid_v7 and its uuid_v4 alias are available in 0.4.1 and produce UUID values like the examples; add focused coverage for both methods.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend, security
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.