orcid_to_shorcid: Converting ORCIDs to ShORCIDs and vice versa
Description
These functions produce ShORCIDs (Short ORCIDs) from ORCIDs and vice versa.
Usage
orcid_to_shorcid(x)
shorcid_to_orcid(x, url = FALSE)
Value
The ShORCID(s) or ORCID(s), as a character vector.
Arguments
x
The ORCID(s) or ShORCID(s).
url
Whether to also return the ORCID or the ORCID URL (including
the preceding "https://orcid.org/" bit)
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()).