Digest File Hash Function

Description

Function to be used to specify the file where key-value pairs get stored for local disk connections, useful when keys are arbitrary objects. File names are determined using a md5 hash of the object. This is the default argument for fileHashFn in localDiskConn.

Usage

1
digestFileHash(keys, conn)

Arguments

keys

keys to be hashed

conn

a "localDiskConn" object

Details

You shouldn't need to call this directly other than to experiment with what the output looks like or to get ideas on how to write your own custom hash.

Author(s)

Ryan Hafen

See Also

localDiskConn, charFileHash

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# connect to empty localDisk directory
path <- file.path(tempdir(), "irisSplit")
unlink(path, recursive = TRUE)
conn <- localDiskConn(path, autoYes = TRUE, fileHashFn = digestFileHash)
# add some data
addData(conn, list(list("key1", iris[1:10,])))
addData(conn, list(list("key2", iris[11:110,])))
addData(conn, list(list("key3", iris[111:150,])))
# see that files were stored by their key
list.files(path)

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.