Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ feat_common_core = [
"basenc",
"cat",
"cksum",
"md5sum",
"comm",
"cp",
"csplit",
Expand Down Expand Up @@ -407,6 +408,7 @@ uucore = { version = "0.5.0", package = "uucore", path = "src/uucore" }
uucore_procs = { version = "0.5.0", package = "uucore_procs", path = "src/uucore_procs" }
uu_ls = { version = "0.5.0", path = "src/uu/ls" }
uu_base32 = { version = "0.5.0", path = "src/uu/base32" }
uu_checksum_common = { version = "0.5.0", path = "src/uu/checksum_common" }
uutests = { version = "0.5.0", package = "uutests", path = "tests/uutests" }

[dependencies]
Expand Down Expand Up @@ -436,6 +438,7 @@ chmod = { optional = true, version = "0.5.0", package = "uu_chmod", path = "src/
chown = { optional = true, version = "0.5.0", package = "uu_chown", path = "src/uu/chown" }
chroot = { optional = true, version = "0.5.0", package = "uu_chroot", path = "src/uu/chroot" }
cksum = { optional = true, version = "0.5.0", package = "uu_cksum", path = "src/uu/cksum" }
md5sum = { optional = true, version = "0.5.0", package = "uu_md5sum", path = "src/uu/md5sum" }
comm = { optional = true, version = "0.5.0", package = "uu_comm", path = "src/uu/comm" }
cp = { optional = true, version = "0.5.0", package = "uu_cp", path = "src/uu/cp" }
csplit = { optional = true, version = "0.5.0", package = "uu_csplit", path = "src/uu/csplit" }
Expand Down
3 changes: 2 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ PROGS := \
basename \
cat \
cksum \
md5sum \
comm \
cp \
csplit \
Expand Down Expand Up @@ -186,7 +187,6 @@ SELINUX_PROGS := \

HASHSUM_PROGS := \
b2sum \
md5sum \
sha1sum \
sha224sum \
sha256sum \
Expand Down Expand Up @@ -223,6 +223,7 @@ TEST_PROGS := \
chmod \
chown \
cksum \
md5sum \
comm \
cp \
csplit \
Expand Down
1 change: 0 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ pub fn main() {
phf_map.entry(krate, format!("({krate}::uumain, {krate}::uu_app_custom)"));

let map_value = format!("({krate}::uumain, {krate}::uu_app_common)");
phf_map.entry("md5sum", map_value.clone());
phf_map.entry("sha1sum", map_value.clone());
phf_map.entry("sha224sum", map_value.clone());
phf_map.entry("sha256sum", map_value.clone());
Expand Down
10 changes: 10 additions & 0 deletions fuzz/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/common/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ fn get_canonical_util_name(util_name: &str) -> &str {
"[" => "test",

// hashsum aliases - all these hash commands are aliases for hashsum
"md5sum" | "sha1sum" | "sha224sum" | "sha256sum" | "sha384sum" | "sha512sum" | "b2sum" => {
"sha1sum" | "sha224sum" | "sha256sum" | "sha384sum" | "sha512sum" | "b2sum" => {
"hashsum"
}

Expand Down Expand Up @@ -98,7 +98,6 @@ mod tests {
fn test_get_canonical_util_name() {
// Test a few key aliases
assert_eq!(get_canonical_util_name("["), "test");
assert_eq!(get_canonical_util_name("md5sum"), "hashsum");
assert_eq!(get_canonical_util_name("dir"), "ls");

// Test passthrough case
Expand Down
35 changes: 35 additions & 0 deletions src/uu/checksum_common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[package]
name = "uu_checksum_common"
description = "Base for checksum utils"
version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true
edition.workspace = true
readme.workspace = true

[lints]
workspace = true

[lib]
path = "src/lib.rs"

[dependencies]
clap = { workspace = true }
uucore = { workspace = true, features = [
"checksum",
"encoding",
"sum",
"hardware",
] }
fluent = { workspace = true }

[dev-dependencies]
divan = { workspace = true }
tempfile = { workspace = true }

# [[bench]]
# name = "b2sum_bench"
# harness = false
1 change: 1 addition & 0 deletions src/uu/checksum_common/LICENSE
19 changes: 19 additions & 0 deletions src/uu/checksum_common/locales/en-US.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ck-common-after-help = With no FILE or when FILE is -, read standard input

# checksum argument help messages
ck-common-help-algorithm = select the digest type to use. See DIGEST below
ck-common-help-untagged = create a reversed style checksum, without digest type
ck-common-help-tag-default = create a BSD style checksum (default)
ck-common-help-tag = create a BSD style checksum
ck-common-help-text = read in text mode (default)
ck-common-help-length = digest length in bits; must not exceed the max size and must be a multiple of 8 for blake2b; must be 224, 256, 384, or 512 for sha2 or sha3
ck-common-help-check = read checksums from the FILEs and check them
ck-common-help-base64 = emit base64-encoded digests, not hexadecimal
ck-common-help-raw = emit a raw binary digest, not hexadecimal
ck-common-help-zero = end each output line with NUL, not newline, and disable file name escaping
ck-common-help-strict = exit non-zero for improperly formatted checksum lines
ck-common-help-warn = warn about improperly formatted checksum lines
ck-common-help-status = don't output anything, status code shows success
ck-common-help-quiet = don't print OK for each successfully verified file
ck-common-help-ignore-missing = don't fail or report status for missing files
ck-common-help-debug = print CPU hardware capability detection info used by cksum
19 changes: 19 additions & 0 deletions src/uu/checksum_common/locales/fr-FR.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
ck-common-after-help = Sans FICHIER ou quand FICHER est -, lit l'entrée standard

# Messages d'aide d'arguments checksum
ck-common-help-algorithm = sélectionner le type de condensé à utiliser. Voir DIGEST ci-dessous
ck-common-help-untagged = créer une somme de contrôle de style inversé, sans type de condensé
ck-common-help-tag-default = créer une somme de contrôle de style BSD (par défaut)
ck-common-help-tag = créer une somme de contrôle de style BSD
ck-common-help-text = lire en mode texte (par défaut)
ck-common-help-length = longueur du condensé en bits ; ne doit pas dépasser le maximum pour l'algorithme blake2 et doit être un multiple de 8
ck-common-help-raw = émettre un condensé binaire brut, pas hexadécimal
ck-common-help-strict = sortir avec un code non-zéro pour les lignes de somme de contrôle mal formatées
ck-common-help-check = lire les sommes de hachage des FICHIERs et les vérifier
ck-common-help-base64 = émettre un condensé base64, pas hexadécimal
ck-common-help-warn = avertir des lignes de somme de contrôle mal formatées
ck-common-help-status = ne rien afficher, le code de statut indique le succès
ck-common-help-quiet = ne pas afficher OK pour chaque fichier vérifié avec succès
ck-common-help-ignore-missing = ne pas échouer ou signaler le statut pour les fichiers manquants
ck-common-help-zero = terminer chaque ligne de sortie avec NUL, pas un saut de ligne, et désactiver l'échappement des noms de fichiers
ck-common-help-debug = afficher les informations de débogage sur la détection de la prise en charge matérielle du processeur
Loading
Loading