1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 09:14:58 +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:
LuK1337 2021-07-31 19:05:27 +02:00 committed by Gunnar Beutner
parent c5df5e504c
commit cf4bd4e4c9

View file

@ -63,7 +63,7 @@ int main(int argc, char** argv)
fail = true;
continue;
}
outln("{} {} {}", crc32.digest(), st.st_size, path);
outln("{:08x} {} {}", crc32.digest(), st.st_size, path);
} else if (algorithm == "adler32") {
Crypto::Checksum::Adler32 adler32;
while (!file->eof() && !file->has_error())
@ -73,7 +73,7 @@ int main(int argc, char** argv)
fail = true;
continue;
}
outln("{} {} {}", adler32.digest(), st.st_size, path);
outln("{:08x} {} {}", adler32.digest(), st.st_size, path);
} else {
warnln("{}: Unknown checksum algorithm: {}", argv[0], algorithm);
exit(1);