BioCompute Objects checksum validator (v1.3.0)

validate_checksum_v1.3.0(file)

validate_checksum(file)

Arguments

file

Path to the BCO JSON file

Value

Logical. TRUE if the checksum matched, FALSE if not.

Note

An SHA-256 checksum is calculated and stored in the top level fields when a BioCompute Object is created. In reality, due to the delicate differences in how the data in JSON is represented, parsed, and handled in different languages, there could be false positives in the validation results.

Examples

bco <- tempfile(fileext = ".json") generate_example("HCV1a") %>% convert_json() %>% export_json(bco) bco %>% validate_checksum()
#> ── Loading BioCompute Object ────────────────────────────────────────────────────────────────────────────────────────────── #> ── Validating Checksum ──────────────────────────────────────────────────────────────────────────────────────────────────── #> Documented checksum: 31ad400fdc50d044255391288b9f48d33beb82a58bf16ec2185c58596277a243 #> Calculated checksum: 31ad400fdc50d044255391288b9f48d33beb82a58bf16ec2185c58596277a243 #> Documented and calculated checksum matched.