Hashes strings (a normalised URL, a title and year) into short identifiers, for sources that give none. The same string always gives the same identifier, on any machine.
Arguments
- x
Character. Strings to hash (normalise them first, e.g. URLs without tracking parameters).
- n
Integer. Number of hexadecimal characters kept (12 characters give 16^12, about 2.8e14, values: collisions are negligible below millions of records).
- algo
Character. Hash algorithm passed to
digest::digest().
See also
Other identifiers:
make_doc_id(),
make_slug(),
pad_id()
Examples
hash_id(c("https://www.bis.org/publ/work1234.htm", NA))
#> [1] "6f80224d6b07" NA