Skip to content

Commit

Permalink
πŸ› N2k_manifest() get a stable fingerprint
Browse files Browse the repository at this point in the history
A different order of the attributes leads to a different fingerprint
  • Loading branch information
ThierryO committed Feb 6, 2025
1 parent aa9b75a commit b634f1d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions R/n2k_manifest.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ setMethod(
noNA(manifest$fingerprint)
)

if (inherits(manifest, "tbl")) {
manifest <- as.data.frame(manifest)
}
manifest |>
as.data.frame() |>
distinct(.data$fingerprint, .data$parent) |>
arrange(.data$fingerprint, .data$parent) -> manifest
new("n2kManifest", Manifest = manifest, Fingerprint = sha1(manifest))
arrange(.data$fingerprint, .data$parent) -> manif
attributes(manif) <- attributes(manif)[c("names", "row.names", "class")]
new("n2kManifest", Manifest = manif, Fingerprint = sha1(manif))
}
)

0 comments on commit b634f1d

Please sign in to comment.