The digest package provides a principal function
digest() for the creation of hash digests of arbitrary R objects (using the md5, sha-1, sha-256, crc32, xxhash, murmurhash, spookyhash and blake3 algorithms) permitting easy comparison of R language objects.
As R can serialize any object, we can run
digest() on any object:
By using the hash sum, which is very likely to be unique, to identify an underlying object or calculation, one can easily implement caching strategies. This is a common use of the digest package.
A small number of additional functions is available:
sha1()for numerally stable hashsums,
hmac()for hashed message authentication codes based on a key,
AES()for Advanced Encryption Standard block ciphers.
Please note that this package is not meant to be deployed for cryptographic purposes. More comprehensive and widely tested libraries such as OpenSSL should be used instead.
The package is on CRAN and can be installed via a standard
As we rely on the tinytest package, the already-installed package can also be verified via
at any later point.
Dirk Eddelbuettel, with contributions by Antoine Lucas, Jarek Tuszynski, Henrik Bengtsson, Simon Urbanek, Mario Frasca, Bryan Lewis, Murray Stokely, Hannes Muehleisen, Duncan Murdoch, Jim Hester, Wush Wu, Qiang Kou, Thierry Onkelinx, Michel Lang, Viliam Simko, Kurt Hornik, Radford Neal, Kendon Bell, Matthew de Queljoe, Ion Suruceanu, Bill Denney, and Dirk Schumacher.
GPL (>= 2)