Wolf, Steven <wolfs...@msu.edu> [2014-03-18 21:05]:
> I am looking for a verification protocol which can look at a data file and 
> see if it has been modified.  Ideally, this should be something that I can 
> check the file with to see if the file has been changed or corrupted and 
> incorporate into my analysis workflow.  (i.e., every time I look at my data, 
> I can run this protocol to ensure the file hasn?t changed.)

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

Overview

digest provides `hash' function summaries for GNU R objects. The md5,
sha-1, sha-256 and crc32 hash functions are available. The md5
algorithm by Ron Rivest is specified in RFC 1321, the SHA-1 and
SHA-256 algorithm is specified in FIPS-180-1 and FIPS-180-2,
respectively, and the crc32 algorithm is described in here. For md5,
sha-1 and sha-256, this packages uses small standalone C
implementations that were provided by by Christophe Devine. For crc32,
code from the zlib library is used. For sha-512, a routine by Aaron
Gifford is used. 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.

Example

The following verbatim R session loads digest and runs the example()
from the corresponding help page:

> library(digest)
> example(digest)

digest> md5Input <- c("", "a", "abc", "message digest", 
"abcdefghijklmnopqrstuvwxyz",
    "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",
    paste("12345678901234567890123456789012345678901234567890123456789012",
        "34567890123456 ..." ... [TRUNCATED]
[...]

HTH,

-rex
-- 
"...I paid a visit to Schrodinger in his Vienna apartment before his death...
There were no cats. I was told he did not like cats." -quantam leaps,
bernstein.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to