Create Compact Hash Digests of R Objects

Implementation of a function 'digest()' for the creation of hash digests of arbitrary R objects (using the 'md5', 'sha-1', 'sha-256', 'crc32', 'xxhash' and 'murmurhash' algorithms) permitting easy comparison of R language objects, as well as a function 'hmac()' to create hash-based message authentication code. Please note that this package is not meant to be deployed for cryptographic purposes for which more comprehensive (and widely tested) libraries such as 'OpenSSL' should be used.


Compact hash representations of arbitrary R objects

Overview

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 and murmurhash algorithms) permitting easy comparison of R language objects.

Examples

As R can serialize any object, we can run digest() on any object:

R> library(digest)
R> digest(trees)
[1] "12412cbfa6629c5c80029209b2717f08"
R> digest(lm(log(Height) ~ log(Girth), data=trees))
[1] "e25b62de327d079b3ccb98f3e96987b1"
R> digest(summary(lm(log(Height) ~ log(Girth), data=trees)))
[1] "86c8c979ee41a09006949e2ad95feb41"
R> 

By using the hash sum, which is very likely to be unique, to identify an underlying object or calculation, one can easily caching strategies for which the digest package is somewhat widely used.

Other Functions

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.

Note

Please note that this package is not meant to be deployed for cryptographic purposes for which more comprehensive (and widely tested) libraries such as OpenSSL should be used.

Author

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 and Viliam Simko.

License

GPL (>= 2)

News

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("digest")

0.6.17 by Dirk Eddelbuettel, 8 days ago


http://dirk.eddelbuettel.com/code/digest.html


Report a bug at https://github.com/eddelbuettel/digest/issues


Browse source code at https://github.com/cran/digest


Authors: Dirk Eddelbuettel <[email protected]> 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 and Radford Neal.


Documentation:   PDF Manual  


GPL (>= 2) license


Suggests knitr, rmarkdown


Imported by ALA4R, BETS, BatchJobs, BetaBit, CorrectOverloadedPeaks, Crossover, DataPackageR, FRK, FSelector, FeatureHashing, GWSDAT, Knoema, LLSR, MALDIquantForeign, MTurkR, MonetDB.R, MonetDBLite, MplusAutomation, NMF, OpasnetUtils, OpenML, OpenMx, PKNCA, PoloniexR, R.cache, R.filesets, R.rsp, R2MLwiN, RCMIP5, ROAuth, RSiteCatalyst, Rbitcoin, Rexperigen, RxODE, SGP, UNF, adapr, alterryx, aqp, archivist, archivist.github, aws.s3, aws.signature, batchtools, baytrends, boxr, calpassapi, cancensus, caretEnsemble, coala, colorplaner, covr, cronR, crsra, dMod, datadr, datapack, devtools, distcomp, downloader, dparser, dplR, dpmr, drake, duawranglr, ecd, epitrix, ezsim, fbRads, feedeR, finch, future, geiger, geoparser, ggmap, ggplot2, ggraph, glmbb, googleAuthR, harvestr, hoardr, htmltools, httpcache, httptest, hunspell, knitcitations, kzfs, lazyrmd, lintr, loose.rock, madrat, memo, memoise, micemd, mleap, monkeylearn, msgtools, nat, nat.templatebrains, neurohcp, nlsr, officer, opensensmapr, optmatch, packagedocs, pander, particles, pkgdown, pkgmaker, placement, plotly, poio, pomp, prettymapr, proton, qle, qmethod, r6extended, radix, rbokeh, rclimateca, rcmdcheck, rcreds, rdrop2, readMzXmlData, readtext, repmis, repo, reproducible, rerddap, rmapzen, rmonad, rngtools, routr, roxygen2, rrepast, rsconnect, rtext, scatterD3, scidb, sealr, semtree, sharpshootR, shiny, shinyFeedback, shinyalert, shinycssloaders, shinyjs, shinytest, simpleRCache, sisal, sparklyr, stepR, storr, swirl, tangram, tesseract, testthat, text2vec, textrank, textreuse, userfriendlyscience, vegalite, zooimage.

Depended on by DataEntry, ElstonStewart, blockmodels, coprimary, gWidgets2, gWidgets2tcltk, gWidgetstcltk, glmm, gmDatabase, likelihoodAsy, mlvocab, rgdax, traitr, x3ptools.

Suggested by CUB, FuzzyNumbers, LDAvis, ProjectTemplate, R.devices, R.utils, REBayes, TurtleGraphics, anonymizer, brms, dataone, enc, hyperSpec, igraph, jointseg, knitr, lfe, mlrCPO, openssl, rEDM, rmarkdown, robustlmm, rstanarm, rts, simulator, swirlify, textmineR.


See at CRAN