| md5_check | R Documentation |
This function allows users to (i) generate md5 checksums on files that have been copied/download/transferred and (ii) check that these match with md5 checksums generated on the original files.
md5_check(file_paths, original_md5, column_to_join_by)
file_paths |
a
|
original_md5 |
a
|
column_to_join_by |
|
a tibble object with the following columns:
file_path: full file path for files for which md5s were generated
file_name: file name
original_md5: original md5 checksum
new_md5: generated md5 checksum
same_md5: contains values TRUE/FALSE; FALSE if md5
checksums do not match, and TRUE if they match.
file_path <-
system.file(
"testdata",
package = "rutils",
mustWork = TRUE
)
original_md5 <-
readr::read_delim(
file.path(file_path, "md5_test_data.txt"),
delim = "\t"
)
file_paths <-
tibble::tibble(
file_path =
list.files(
file_path,
pattern = "over.chain",
full.names = TRUE
)
) %>%
dplyr::mutate(
file_name = basename(file_path)
)
md5_df <-
md5_check(
file_paths = file_paths,
original_md5 = original_md5,
column_to_join_by = "file_name"
)
md5_df
print("All check sums match between files?")
all(md5_df$same_md5)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.