1.0.1 • Published 10 months ago

@fua/core.uuid v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

@fua/core.uuid

The formal definition of the UUID string representation is provided by the following ABNF:

UUID                   = time-low "-" time-mid "-"
                         time-high-and-version "-"
                         clock-seq-and-reserved
                         clock-seq-low "-" node
time-low               = 4hexOctet
time-mid               = 2hexOctet
time-high-and-version  = 2hexOctet
clock-seq-and-reserved = hexOctet
clock-seq-low          = hexOctet
node                   = 6hexOctet
hexOctet               = hexDigit hexDigit
hexDigit               = "0" / "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" /
                         "a" / "b" / "c" / "d" / "e" / "f" /
                         "A" / "B" / "C" / "D" / "E" / "F"

Version 4: UUID from truly-random or pseudo-random numbers

The algorithm is as follows:

  • Set the two most significant bits (bits 6 and 7) of the clock_seq_hi_and_reserved to 0 and 1, respectively.
  • Set the four most significant bits (bits 12 through 15) of the time_hi_and_version field to the 4-bit version number 0 1 0 0.
  • Set all the other bits to randomly (or pseudo-randomly) chosen values.