Skip to content

Commit

Permalink
Use digest chain_update when hashing
Browse files Browse the repository at this point in the history
  • Loading branch information
russellbanks committed Jan 26, 2024
1 parent c3cebe1 commit a85dce4
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ pub fn get_package_family_name(identity_name: &str, identity_publisher: &str) ->
let publisher_sha_256 = identity_publisher
.encode_utf16()
.flat_map(u16::to_le_bytes)
.fold(Sha256::new(), |mut buf, byte| {
buf.update([byte]);
buf
})
.fold(Sha256::new(), |buf, byte| buf.chain_update([byte]))
.finalize();

format!(
Expand Down

0 comments on commit a85dce4

Please sign in to comment.