Title: | Fast, Low Memory Footprint Digests of R Objects |
---|---|
Description: | Provides an R interface to Bob Jenkin's streaming, non-cryptographic 'SpookyHash' hash algorithm for use in digest-based comparisons of R objects. 'fastdigest' plugs directly into R's internal serialization machinery, allowing digests of all R objects the serialize() function supports, including reference-style objects via custom hooks. Speed is high and scales linearly by object size; memory usage is constant and negligible. |
Authors: | Gabriel Becker, based on SpookyHash algorithm and C++ code by Bob Jenkins |
Maintainer: | Gabriel Becker <[email protected]> |
License: | Artistic-2.0 |
Version: | 0.6-4 |
Built: | 2024-11-01 11:19:12 UTC |
Source: | https://github.com/cran/fastdigest |
Fast, memory constant hashing of R objects
fastdigest(obj, ref_serializer = NULL)
fastdigest(obj, ref_serializer = NULL)
obj |
The object to generate a hash digest for |
ref_serializer |
(optional) A serializer for reference-style
objects, see |
obj
will be hashed using R's internal serialization logic
with a custom target which applies applying Jenkins' SpookyHash (v2) in a
streaming fashion. This avoids (ever) copying the data out of the R object
itself, providing both speed and memory constancy.
It also guarantees that the "representation" of the R object being hashed is the same as the serialized version would be, if created.
Gabriel Becker
Jenkins, B. (2012). SpookyHash: a 128-bit noncryptographic hash. http://burtleburtle.net/bob/hash/spooky.html.
fastdigest(1:5) fastdigest(list("what", 1:2))
fastdigest(1:5) fastdigest(list("what", 1:2))