Skip to content
Merged
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
45 changes: 22 additions & 23 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion conformance/mock-provider/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ publish = false

[dependencies]
lpp-conformance-common = { path = "../common" }
sha2 = "0.10"
sha2 = "0.11"
serde = { workspace = true, features = ["derive"] }
serde_json.workspace = true

Expand Down
9 changes: 8 additions & 1 deletion conformance/mock-provider/src/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use std::collections::HashMap;

use serde_json::{Value, json};
use sha2::{Digest, Sha256};
use std::fmt::Write;

use crate::project::documents_for_request;
use crate::puzzle::{
Expand Down Expand Up @@ -436,7 +437,13 @@ fn select_artifact_format(accepted: Option<Vec<String>>) -> Result<&'static str,
fn sha256_hex(text: &str) -> String {
let mut hasher = Sha256::new();
hasher.update(text.as_bytes());
format!("{:x}", hasher.finalize())
hasher
.finalize()
.iter()
.fold(String::new(), |mut hex, byte| {
write!(hex, "{byte:02x}").expect("writing to a String cannot fail");
hex
})
}

/// Document-set entries in key order.
Expand Down
Loading