crypto: Use the chain method to get the sha hash of the content
This commit is contained in:
parent
3f3ae794a4
commit
43ea9a16a0
1 changed files with 3 additions and 1 deletions
|
@ -63,10 +63,12 @@ pub struct SasIds {
|
|||
/// interactive verification process.
|
||||
pub fn calculate_commitment(public_key: &str, content: impl Into<StartContent>) -> String {
|
||||
let content = content.into().canonical_json();
|
||||
let content_string = content.to_string();
|
||||
|
||||
encode(
|
||||
Sha256::new()
|
||||
.chain(&format!("{}{}", public_key, content))
|
||||
.chain(&public_key)
|
||||
.chain(&content_string)
|
||||
.finalize(),
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue