https://github.com/janlelis/yyid.rb
Almost a random UUID in Ruby
https://github.com/janlelis/yyid.rb
ruby uuid yyid
Last synced: 9 months ago
JSON representation
Almost a random UUID in Ruby
- Host: GitHub
- URL: https://github.com/janlelis/yyid.rb
- Owner: janlelis
- License: mit
- Created: 2014-07-16T20:52:45.000Z (almost 12 years ago)
- Default Branch: main
- Last Pushed: 2021-11-06T14:26:34.000Z (over 4 years ago)
- Last Synced: 2025-09-14T20:04:23.223Z (9 months ago)
- Topics: ruby, uuid, yyid
- Language: Ruby
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: MIT-LICENSE.txt
Awesome Lists containing this project
README
# YYID for Ruby [![[version]](https://badge.fury.io/rb/yyid.svg)](https://badge.fury.io/rb/yyid) [![[ci]](https://github.com/janlelis/yyid.rb/workflows/Test/badge.svg)](https://github.com/janlelis/yyid.rb/actions?query=workflow%3ATest)
- Generates a random string in [UUID#4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_.28random.29) format: `xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`
- In contrast to [RFC 4122](https://tools.ietf.org/rfc/rfc4122.txt), it uses all digits (128bit)
- Uses a crytographically solid source of randomness: [SecureRandom](https://github.com/ruby/ruby/blob/v2_1_2/lib/securerandom.rb)
## Install
```
$ gem install yyid
```
## Usage
```ruby
require 'yyid'
YYID.new #=> "9a4161c6-7742-b6ea-301a-d1e5e1df151d"
```
## Other Versions
[YYID](https://github.com/micromodules/yyid) is available for more languages, such as JavaScript, Elixir, or Rust.