Skip to content

gwik/e2fs-uuid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

UUID

Ruby C extension provide access to the uuid library from e2fs project available in most unix systems.

DESCRIPTION

uuid is used to generate unique identifiers across all systems.

Here is the description from the uuid manpage :

The UUID library is used to generate unique identifiers for objects that may be accessible beyond the local system. This library generates UUIDs compatible with those created by the Open Software Foundation (OSF) Distributed Computing Environment (DCE) utility uuidgen.

The UUIDs generated by this library can be reasonably expected to be unique within a system, and unique across all systems. They could be used, for instance, to generate unique HTTP cookies across multiple web servers without communication between the servers, and without fear of a name clash.

USAGE

require 'e2fs-uuid'

E2FS::UUID.new.to_s 
=> "8c834593-fabd-477e-9534-e7e79bbfc88e"

uuid = E2FS::UUID.new
=> #<E2FS::UUID:0x26dcc @ary=[210, 21, 19, 169, 41, 84, 69, 56, 141, 184, 93, 233, 140, 66, 142, 81]>

uuid.to_s 
=> "d21513a9-2954-4538-8db8-5de98c428e51"

uuid.to_s :default
=> "d21513a9-2954-4538-8db8-5de98c428e51"

uuid.to_s :nosep
=> "d21513a9295445388db85de98c428e51"

uuid.to_a
=> [210, 21, 19, 169, 41, 84, 69, 56, 141, 184, 93, 233, 140, 66, 142, 81]    

Generators

Here follows generators differences (form uuid_generate manpage)

The uuid_generate function creates a new universally unique identifier (UUID). The uuid will be generated based on high-quality randomness from /dev/urandom, if available. If it is not available, then uuid_generate will use an alternative algorithm which uses the current time, the local ethernet MAC address (if available), and random data generated using a pseudo-random generator.

The uuid_generate_random function forces the use of the all-random UUID format, even if a high-quality random number generator (i.e., /dev/urandom) is not available, in which case a pseudo-random generator will be subsituted. Note that the use of a pseudo-random generator may compromise the uniqueness of UUID's generated in this fashion.

The uuid_generate_time function forces the use of the alternative algo- rithm which uses the current time and the local ethernet MAC address (if available). This algorithm used to be the default one used to gen- erate UUID, but because of the use of the ethernet MAC address, it can leak information about when and where the UUID was generated. This can cause privacy problems in some applications, so the uuid_generate func- tion only uses this algorithm if a high-quality source of randomness is not available.

About

Ruby C bindings to e2fs uuid library - generate safe uuids across all systems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published