Skip to content

Instantly share code, notes, and snippets.

@chasemc
Last active January 11, 2020 18:27
Show Gist options
  • Save chasemc/f9e3b2f3ec44fd27ed59e32bfc0894c8 to your computer and use it in GitHub Desktop.
Save chasemc/f9e3b2f3ec44fd27ed59e32bfc0894c8 to your computer and use it in GitHub Desktop.
Generate a list of sha1 hashes given file paths
# requires openssl package
hash_files <- function(paths){
num_paths <- length(paths)
pb <- txtProgressBar(max=num_paths)
lapply(seq_along(paths), function(x){
setTxtProgressBar(pb, x)
flush.console()
openssl::sha1(file(paths[[x]]))
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment