Class: UUIDGen::NameBasedUUID
- Defined in:
- lib/uuidgen/name_based_uuid.rb
Instance Attribute Summary
Attributes inherited from UUID
Instance Method Summary collapse
-
#initialize(name, name_space = NameSpaceDNS) ⇒ NameBasedUUID
constructor
A new instance of NameBasedUUID.
Methods inherited from UUID
Constructor Details
#initialize(name, name_space = NameSpaceDNS) ⇒ NameBasedUUID
Returns a new instance of NameBasedUUID.
4 5 6 7 8 |
# File 'lib/uuidgen/name_based_uuid.rb', line 4 def initialize(name, name_space=NameSpaceDNS) concated = name_space.to_hexa_string + name decimal_hash = uuid_hash(concated).to_i(16) @decimal = set_version(set_reserved(decimal_hash)) end |