checksum: Calculate Checksums and Cryptographic Hashes

Description Usage Arguments Details Value Author(s) See Also Examples

Description

This is a generic function for applying cryptographic hash functions and calculating checksums for arbitrary R objects.

Usage

1
2
3
4
checksum(x, ...)

## S4 method for signature 'matter'
checksum(x, algo = c("sha1", "md5"), ...)

Arguments

x

An object to be hashed.

algo

The hash function to use.

...

Additional arguments to be passed to the hash function.

Details

The method for matter objects calculates checksums of each of the files in the object's paths.

Value

A character vector giving the hash or hashes of the object.

Author(s)

Kylie A. Bemis

See Also

digest

Examples

1
2
3
4
5
x <- matter(1:10)
y <- matter(1:10)

checksum(x)
checksum(y) # should be the same

Example output

Loading required package: BiocParallel
Loading required package: Matrix
Loading required package: biglm
Loading required package: DBI

Attaching package:matterThe following object is masked frompackage:biglm:

    biglm

The following objects are masked frompackage:base:

    apply, scale

Warning message:
In .Call("C_setVector", x, value, PACKAGE = "matter") :
  converting NULL pointer to R NULL
Warning message:
In .Call("C_setVector", x, value, PACKAGE = "matter") :
  converting NULL pointer to R NULL
/work/tmp/tmp/RtmpqleYVU/file74e0224e49d82.bin 
    "e0d2592373a0c161e56e266306cd8405cd719d19" 
attr(,"algo")
[1] "sha1"
/work/tmp/tmp/RtmpqleYVU/file74e0266b3a837.bin 
    "e0d2592373a0c161e56e266306cd8405cd719d19" 
attr(,"algo")
[1] "sha1"

matter documentation built on Nov. 8, 2020, 6:15 p.m.