mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 21:27:34 +00:00
checksum: Use :hex-dump
to format digest
value
This commit is contained in:
parent
23fe07a148
commit
25251f1b05
1 changed files with 1 additions and 6 deletions
|
@ -65,12 +65,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
||||||
while (!file->eof() && !file->has_error())
|
while (!file->eof() && !file->has_error())
|
||||||
hash.update(file->read(PAGE_SIZE));
|
hash.update(file->read(PAGE_SIZE));
|
||||||
auto digest = hash.digest();
|
auto digest = hash.digest();
|
||||||
auto digest_data = digest.immutable_data();
|
outln("{:hex-dump} {}", ReadonlyBytes(digest.immutable_data(), digest.data_length()), path);
|
||||||
StringBuilder builder;
|
|
||||||
for (size_t i = 0; i < hash.digest_size(); ++i)
|
|
||||||
builder.appendff("{:02x}", digest_data[i]);
|
|
||||||
auto hash_sum_hex = builder.build();
|
|
||||||
outln("{} {}", hash_sum_hex, path);
|
|
||||||
}
|
}
|
||||||
return has_error ? 1 : 0;
|
return has_error ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue