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', 'murmurhash', 'spookyhash', 'blake3', 'crc32c', 'xxh3_64', and 'xxh3_128' algorithms) permitting easy comparison of R language objects, as well as functions such as '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.


digest: Hash representations of arbitrary R objects

ci License CRAN Dependencies Debian package r-universe Downloads (monthly) Downloads (total) CRAN use CRAN indirect BioConductor use Code Coverage Last Commit Documentation

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, murmurhash, spookyhash, blake3, crc32c, xxh3_64, and xxh3_128 algorithms) permitting easy comparison of R language objects.

Extensive documentation is available at the package documentation site.

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 implement caching strategies. This is a common use of the digest package.

Other Functions

A small number of additional functions is available:

  • sha1() for numerically stable hashsums,
  • hmac() for hashed message authentication codes based on a key,
  • AES() for Advanced Encryption Standard block ciphers,
  • getVDigest() as a function generator for vectorised versions.

Note

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.

Installation

The package is on CRAN and can be installed via a standard

install.packages("digest")

Continued Testing

As we rely on the tinytest package, the already-installed package can also be verified via

tinytest::test_package("digest")

at any later point.

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, Viliam Simko, Kurt Hornik, Radford Neal, Kendon Bell, Matthew de Queljoe, Ion Suruceanu, Bill Denney, Dirk Schumacher, Winston Chang, Dean Attali, and Michael Chirico.

License

GPL (>= 2)

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.39 by Dirk Eddelbuettel, a year ago


https://github.com/eddelbuettel/digest, https://eddelbuettel.github.io/digest/, https://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 [aut, cre] (ORCID: , Antoine Lucas [ctb] , Jarek Tuszynski [ctb] , Henrik Bengtsson [ctb] , Simon Urbanek [ctb] , Mario Frasca [ctb] , Bryan Lewis [ctb] , Murray Stokely [ctb] , Hannes Muehleisen [ctb] (ORCID: , Duncan Murdoch [ctb] , Jim Hester [ctb] , Wush Wu [ctb] , Qiang Kou [ctb] , Thierry Onkelinx [ctb] , Michel Lang [ctb] , Viliam Simko [ctb] , Kurt Hornik [ctb] , Radford Neal [ctb] , Kendon Bell [ctb] , Matthew de Queljoe [ctb] , Dmitry Selivanov [ctb] , Ion Suruceanu [ctb] , Bill Denney [ctb] , Dirk Schumacher [ctb] , AndrĂ¡s Svraka [ctb] , Sergey Fedorov [ctb] , Will Landau [ctb] , Floris Vanderhaeghe [ctb] (ORCID: , Kevin Tappe [ctb] , Harris McGehee [ctb] , Tim Mastny [ctb] , Aaron Peikert [ctb] , Mark van der Loo [ctb] , Chris Muir [ctb] , Moritz Beller [ctb] , Sebastian Campbell [ctb] (ORCID: , Winston Chang [ctb] , Dean Attali [ctb] , Michael Chirico [ctb] , Kevin Ushey [ctb] , Carl Pearson [ctb]


Documentation:   PDF Manual  


GPL (>= 2) license


Imports utils

Suggests tinytest, simplermarkdown, rbenchmark


Imported by AI4OfficialStats, BatchJobs, BetaBit, BinaryDosage, BuildSys, CLVTools, Capsule, Characterization, CohortGenerator, CohortMethod, Crossover, DDESONN, DDIwR, DataPackageR, DataSpaceR, DatabaseConnector, EML, EWAScaller, FRK, FSelector, FSinR, GGIRread, GWSDAT, IRkernel, JWileymisc, LDATS, LLMR, LLMRagent, LLSR, LSDirf, LSX, MALDIquantForeign, MarineChain, MatchingPursuit, MplusAutomation, NGCHM, NMF, OPCC, One4All, OpenML, OpenMx, OpenSpecy, PKNCA, PatientLevelPrediction, QuickExplore, R.cache, R.filesets, R.rsp, R2MLwiN, RCTCovAdj, RDesk, RIbench, ROAuth, Rapi, Rborist, RestRserve, Rpolyhedra, SGP, SelfControlledCaseSeries, SimInf, TesiproV, UCSCXenaShiny, UCSCXenaTools, VancouvR, VectrixDB, WFC, WebAnalytics, abba, accelEE, acdcquery, admixr2, aisdk, amapGeocode, amregtest, animint2, ape, aqp, archivist, ascii, autoimport, aws.s3, aws.signature, azlogr, babelmixr2, babelwhale, batchtools, baytrends, bdpar, bifrost, binancer, binxr, bioLeak, biocompute, bitmexr, blastula, blockmodels, blockr.core, bluertopo, bnns, boilerplate, boxr, bsub, bvarnet, cache, calpassapi, campsis, cancensus, cansim, cardargus, carwatch, catchmentACS, causalDisco, cellKey, chouca, chromConverter, churon, civic.icarm, cmhc, coala, cometr, connectwidgets, corpustools, corteza, covr, craftgrn, crimedata, cronR, cryptotrackr, cstidy, ctmm, cuda.ml, dartR.captive, dataganger, datapack, datom, dipsaus, disordR, distcomp, distill, dittodb, dlr, downlit, downloader, dparser, dplR, drake, dsROCrate, duawranglr, dwctaxon, easyr, ecce, emayili, engager, envar, eurostat, evoFE, exams2forms, fanyi, fbRads, filearray, filehash, finch, finnts, flir, formods, foundryR, fscontext, fuseMLR, future, gadget3, geiger, genpca, geoflow, geometa, geosmooth, ggimage, ggmap, ggmapcn, ggprism, glcdp, glmbb, glmmrOptim, gmsp, gofigR, googleAuthR, gooseR, gsDesignTune, gstsm, hoardr, htmltools, httpcache, httptest, httptest2, hunspell, hydrogeofetch, icarm, icecdr, icertool, ieegio, indexr, irtpwr, istat, job, kableExtra, keyed, knitcitations, krt, languageserver, lavaangui, lbugr, leakr, learnr, lexsync, lintr, llmshieldr, localLLM, login, logrx, mLLMCelltype, madrat, maplamina, maptiles, memo, memofunc, metR, metafor, metasnf, micemd, miscTools, misha, mlpwr, mlr3misc, mlr3pipelines, mmpca, mmstat4, mobdb, modelStudio, mregions2, mudnester, mulset, muttest, mvp, myrror, nat, nat.templatebrains, nativeORT, neotoma2, neurohcp, newmark, nhdR, nhdplusTools, nlmixr2extra, nlmixr2save, nlmixr2targets, nlsr, noah, nomisdata, nonmem2rx, nordstatExtras, npwbs, occupationMeasurement, odin, okf, okxAPI, okxr, onbrand, onlineforecast, oolong, opencis, orderanalyzer, orisma, orthanc, osrm.backend, pander, particles, paws.common, pensar, petersenlab, phangorn, pins, piwikproR, plnr, plotly, pointblank, polished, pomp, portfolioBacktest, predictsr, prettymapr, privacyR, progressr, proton, provExplainR, proximetricsR, pslr, ptvapi, pulso, qmethod, quallmer, r2r, rCoros, rKraken, ravel, ravepipeline, ravetools, raybevel, rayvertex, rb3, rbcb, rbedrock, rcmdcheck, rdhs, rdtLite, reactable, readMzXmlData, readtext, receptiviti, redeem, regulog, repana, repmis, repo, reproducible, reproducibleRchunks, rerddap, rfacts, rfair, rfieldclimate, riskweightedassets, rmapzen, rmdpartials, rms, rmsb, rngtools, rocrateR, rosv, rrepast, rsconnect, rsyntax, rtemis.llm, rtodoist, ruminate, rxref, sarsop, scatterD3, screenllm, searchAnalyzeR, searchlight, seguid, semanticfa, semeqmodels, sharpshootR, shidashi, shiny.telemetry, shinycssloaders, shinyjs, shinylogs, shinytest, simlandr, simpleRCache, simpletex, sisal, skpr, slendr, sotkanet, sourcoise, spanishoddata, spatialkit, spiro, ssel, starburst, statfidelity, statgen, statuser, stepR, storr, stors, stow, swirl, syncdr, tangram, tejoR, telegramR, tesseract, text2vec, textrank, textreuse, tfevents, threeBrain, tidyGenR, tidypaleo, tidytransit, tinyoauth, tinyshinyserver, tradestatistics, transltr, trelliscopejs, trustedtimestamping, tuber, ubiquity, unicefData, uqsa, vegalite, vegawidget, verdata, videogameinsightsR, virtuoso, vtreat, widr, worcs, writeAlizer, wyz.code.rdoc, x3ptools, yulab.utils, zooimage, zot.

Depended on by ProjectTemplate, gWidgets2, gWidgets2tcltk, gmDatabase, likelihoodAsy, rgeoda.

Suggested by ASMap, AutoMLR, BayesERtools, BayesianDEB, CDMConnector, CUB, Certara.RsNLME, CorrectOverloadedPeaks, Fluidigm, FuzzyNumbers, HaDeX, HaDeX2, Hmisc, LBDiscover, LDAvis, R.devices, R.utils, RCBR, REBayes, TextAnalysisR, TurtleGraphics, altdoc, artoo, ato, bcpa, botor, brms, cer, cli, cograph, crosstable, crypto2, csdb, dataone, devtools, dm, dpcR, dpkg, ensr, fcfdr, formatters, fritools, fritools2, gdpar, gedi2, ggmlR, glarma, gson, gtfsrouter, heteroTests, httr2, hutils, hyperSpec, igraph, jointseg, knitr, knitrdata, lame, learningtower, lfe, lightr, mellio, memoise, metabodecon, metabodeconplus, metadat, metasurvey, metrosp, mixpower, mlrCPO, modelsummary, move2, neonstore, nlmixr2est, odiffr, openssl, packager, pavo, pedalfast.data, pedbp, prepR4pcm, provSummarizeR, provTraceR, pxweb, pyinit, raddr, reproducr, rgee, rmarkdown, rmoriebricklayer, rotor, rstanarm, rts, rxode2, s3, sfcurve, shiny.webawesome, sigminer, simulator, sits, spant, stars, styler, surveyframe, swirlify, tabular, testthat, textmineR, weatherjoin, webfakes, zarr.


See at CRAN