Skip to contents

Use orderly2's hashing functions. This is intended for advanced users, in particular those who want to create hashes that are consistent with orderly2 from within plugins. The default behaviour is to use the same algorithm as used in the orderly root (via the root argument, and the usual root location approach). However, if a string is provided for algorithm you can use an alternative algorithm.

Usage

orderly_hash_file(path, algorithm = NULL, root = NULL, locate = TRUE)

orderly_hash_data(data, algorithm = NULL, root = NULL, locate = TRUE)

Arguments

path

The name of the file to hash

algorithm

The name of the algorithm to use, overriding that in the orderly root.

root

The path to the root directory, or NULL (the default) to search for one from the current working directory if locate is TRUE. This function does not require that the directory is configured for orderly, and can be any outpack root (see orderly_init for details).

locate

Logical, indicating if the root should be searched for. If TRUE, then we looks in the directory given for root (or the working directory if NULL) and then up through its parents until it finds an .outpack directory or orderly_config.yml

data

A string to hash

Value

A string in the format <algorithm>:<digest>

Examples

orderly2::orderly_hash_data("hello", "md5")
#> [1] "md5:5d41402abc4b2a76b9719d911017c592"