summaryrefslogtreecommitdiff
path: root/cli/tools/registry/provenance.rs
diff options
context:
space:
mode:
authorMatt Mastracci <matthew@mastracci.com>2024-03-07 10:00:43 -0700
committerGitHub <noreply@github.com>2024-03-07 10:00:43 -0700
commit4791d16a8efc42fb40ffab79bcdae4f0e106cd89 (patch)
tree3d91c75b0d822ba68797da8a33091597f99f7af6 /cli/tools/registry/provenance.rs
parent594d8397ad46a90389bec9a76afde1bc7f1fa35b (diff)
perf(cli): use faster_hex (#22761)
`cli::util::checksum` was showing up on flame graphs because it was concatenating allocated strings. We can use `faster-hex` to improve it.
Diffstat (limited to 'cli/tools/registry/provenance.rs')
-rw-r--r--cli/tools/registry/provenance.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/tools/registry/provenance.rs b/cli/tools/registry/provenance.rs
index 117c10abc..69926372e 100644
--- a/cli/tools/registry/provenance.rs
+++ b/cli/tools/registry/provenance.rs
@@ -622,12 +622,12 @@ async fn testify(
// Rekor "intoto" entry for the given DSSE envelope and signature.
//
// Calculate the value for the payloadHash field into the Rekor entry
- let payload_hash = hex::encode(sha2::Sha256::digest(
+ let payload_hash = faster_hex::hex_string(&sha2::Sha256::digest(
content.dsse_envelope.payload.as_bytes(),
));
// Calculate the value for the hash field into the Rekor entry
- let envelope_hash = hex::encode({
+ let envelope_hash = faster_hex::hex_string(&{
let dsse = DsseEnvelope {
payload: content.dsse_envelope.payload.clone(),
payload_type: content.dsse_envelope.payload_type.clone(),