Missing `#uuid_v4` and `#uuid_v7` methods

未關閉
#37 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
ruby
領域
backend, security

研究方向

先閱讀現有 uuid 方法周圍的 SecureRandom API,並比較其中展示的 0.3.2 和 0.4.1 版本的行為。確認 SecureRandom.uuid_v7 及其 uuid_v4 別名在 0.4.1 中可用,並能產生範例中的 UUID 值;為這兩個方法新增有針對性的覆蓋。

由索引模型根據 Issue 內容生成。

描述

#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
主要語言
Ruby
星號
76
分支
17
平均合併
42 分鐘
30 天內合併 PR
5

環境準備

這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

ruby/securerandom 的其他 Issue

查看 ruby/securerandom 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。