Description Usage Arguments Value QQIDs Process Endianness Author(s) See Also Examples
qq2uu
converts a vector of QQIDs to UUIDs.
1 | qq2uu(qq)
|
qq |
(character) a vector of QQIDs |
(character) a vector of UUIDs
QQIDs are specially formatted 128-bit numbers (hexlets), just
like UUIDs. See xlt2qq()
for the the motivation of
mapping UUIDs to QQIDs and details on how QQIDs are structured.
qq2uu
reverses the mapping exactly to recover the original UUID.
To convert a QQID to a UUID, the two "Q-words" that head
the QQID are mapped to their index in the 0:1023 Q-word vector (cf.
qMap()
), and the indices are converted to two ten bit
numbers. These twenty bits are expressed as a five-digit hexadecimal number
which replaces the two Q-words to recover the UUID. For details on UUID
format see is.xlt()
. The remaining 18 Base64 encoded
characters are converted to their corresponding 27 hex digits via an
intermediate mapping to bit-patterns.
The qqid
package uses its own functions to
convert to and from bits, and is not affected by big-endian vs.
little-endian processor architecture or variant byte order. All numbers are
interpreted to have their lowest order digits on the right.
(c) 2019 Boris Steipe,
licensed under MIT (see file LICENSE
in this package).
xlt2qq()
to convert a vector of UUIDs, IPv6
addresses or other hexlets to QQIDs.
1 2 3 4 5 6 7 8 9 | # Convert three example QQIDs and one NA to the corresponding UUIDs
qq2uu( c(QQIDexample(c(1, 3, 5)), NA) )
# forward and back again
myID <- "bird.carp.7TsBWtwqtKAeCTNk8f"
myID == xlt2qq(qq2uu(myID)) # TRUE
# Confirm that example QQID No. 3 is formatted correctly as a UUID
qq2uu( QQIDexample(3) ) == xltIDexample("UUID") # TRUE
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.