mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
cksum: Display adler32/crc32 sums as hex numbers
This basically follows what `crc32` and `xrdadler32` does on Linux distros.
This commit is contained in:
parent
c5df5e504c
commit
cf4bd4e4c9
1 changed files with 2 additions and 2 deletions
|
@ -63,7 +63,7 @@ int main(int argc, char** argv)
|
||||||
fail = true;
|
fail = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
outln("{} {} {}", crc32.digest(), st.st_size, path);
|
outln("{:08x} {} {}", crc32.digest(), st.st_size, path);
|
||||||
} else if (algorithm == "adler32") {
|
} else if (algorithm == "adler32") {
|
||||||
Crypto::Checksum::Adler32 adler32;
|
Crypto::Checksum::Adler32 adler32;
|
||||||
while (!file->eof() && !file->has_error())
|
while (!file->eof() && !file->has_error())
|
||||||
|
@ -73,7 +73,7 @@ int main(int argc, char** argv)
|
||||||
fail = true;
|
fail = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
outln("{} {} {}", adler32.digest(), st.st_size, path);
|
outln("{:08x} {} {}", adler32.digest(), st.st_size, path);
|
||||||
} else {
|
} else {
|
||||||
warnln("{}: Unknown checksum algorithm: {}", argv[0], algorithm);
|
warnln("{}: Unknown checksum algorithm: {}", argv[0], algorithm);
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue