Converting ORCIDs to ShORCIDs and vice versa
ShORCIDs.Rd
These functions produce ShOCRIDs (Short ORCIDs) from ORCIDs and vice versa.
Details
Conversion ORCID to ShORCID occurs by detaching the last character (the
checksum) and storing it. Then in the first string of characters, all
non-numbers are removed and the resulting number is converted to a base 30
system with numericToBase30()
. The checksum is then re-attached. This is
done separately because the checksum can be X (i.e. the only character in an
ORCID that's not necessarily numeric). Then, an 'i' is prepended to ensure
that the ShORCID starts with a letter. Conversion the other way around just
inverts the process (and so uses base30toNumeric()
).
Examples
rock::orcid_to_shorcid(
"0000-0002-9540-5371"
);
#> [1] "i16g2sk1"
rock::shorcid_to_orcid(
"i16g2sk1"
);
#> [1] "0000-0002-9540-5371"