
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Gem gn_uuid
creates UUID version 5 out of scientific name string. It
uses globalnames.org
domain for DNS namespace. There is a 1:1 relationship
between the string and the corresponding UUID, so it allows globally connect
data about a name string originated from independent sources without a need
to negotiate identifiers. You can find more information about UUID v5 from
the original RFC4122 document.
Add this line to your application's Gemfile:
gem 'gn_uuid'
And then execute:
$ bundle
Or install it yourself as:
$ gem install gn_uuid
Parameter | Type | Description |
---|---|---|
str | String | Scientific Name String |
guid | Boolean | true returns a String guid, false -- UUID object; default true |
require "gn_uuid"
uuid = GnUUID.uuid("Homo sapiens")
# output: 16f235a0-e4a3-529c-9b83-bd15fe722110
If you plan to convert uuid into its other formats use
uuid = GnUUID.uuid("Homo sapiens", false)
# output: urn:uuid:b33e4b19-2399-56c8-9dd3-eff79f221d2f
# as a 'stanard guid'
uuid.to_s
# output: b33e4b19-2399-56c8-9dd3-eff79f221d2f
# as an decimal integer
uuid.to_i
# output: 30500639462008600581628158843502600464
# as an URI
uuid.to_uri
uuid.inspect (alias_method for to_uri)
# output: urn:uuid:b33e4b19-2399-56c8-9dd3-eff79f221d2f
# as a 16-bytes string
uuid.bytes
# output: "\x16\xF25\xA0\xE4\xA3R\x9C\x9B\x83\xBD\x15\xFEr!\x10"
# return UUID version
uuid.version
# output: 5
Please note that the internal GnUUID::UUID does not have to be of the version 5, but GnUUID.uuid generates only version 5 UUIDs
Takes a uuid string like "b33e4b19-2399-56c8-9dd3-eff79f221d2f" and returns an instance of GnUUID::UUID class. It can parse any UUID, not only version 5
uuid = GnUUID.parse("b33e4b19-2399-56c8-9dd3-eff79f221d2f")
uuid.inspect
# output: urn:uuid:b33e4b19-2399-56c8-9dd3-eff79f221d2f
After checking out the repo, run bin/setup
to install dependencies. Then, run
rake rspec
to run the tests. You can also run bin/console
for an
interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To
release a new version, update the version number in version.rb
, and then run
bundle exec rake release
, which will create a git tag for the version, push
git commits and tags, and push the .gem
file to
rubygems.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/GlobalNamesArchitecture/gn_uuid.
This gem heavily borrowed ideas and code from Urabe Shyouhei's ruby-uuid gem
The gem is available as open source under the terms of the MIT License.
Author -- Dmitry Mozzherin
Copyright (c) 2015 Marine Biological Laboratory.
FAQs
Unknown package
We found that gn_uuid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.