Created
September 8, 2021 01:53
-
-
Save joelnitta/2fd5d05fdf9c0910551f4af54d0df884 to your computer and use it in GitHub Desktop.
Make a list of MD5 checksums for files in a folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(tidyverse) | |
# Specify directory with files to get checksums | |
dir <- "my_folder" | |
# Get checksums | |
list.files(dir, full.names = TRUE) %>% | |
tools::md5sum() %>% | |
tibble(file = names(.), checksum = .) %>% | |
filter(!is.na(checksum)) %>% | |
mutate( | |
file = fs::path_file(file), | |
text = glue::glue("{file}: {checksum}")) %>% | |
arrange(file) %>% | |
pull(text) %>% | |
cat(sep = "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment