Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Update sha2 dep to 0.10.1 (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity authored Feb 11, 2022
1 parent f7f9f31 commit 489398a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ include = ["src", "Cargo.toml", "LICENSE", "README.md"]
base32 = "0.4.0"
crc32fast = "1.3.0"
hex = "0.4.3"
sha2 = "0.9.8"
sha2 = "0.10.1"
thiserror = "1.0.30"

[dev-dependencies]
Expand Down
8 changes: 6 additions & 2 deletions src/principal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,10 @@ impl<'de> serde::Deserialize<'de> for Principal {
}

mod inner {
use sha2::{digest::generic_array::typenum::Unsigned, Digest, Sha224};
use sha2::{
digest::{generic_array::typenum::Unsigned, OutputSizeUser},
Sha224,
};

/// Inner structure of a Principal. This is not meant to be public as the different classes
/// of principals are not public.
Expand All @@ -410,7 +413,8 @@ mod inner {
}

impl PrincipalInner {
const HASH_LEN_IN_BYTES: usize = <<Sha224 as Digest>::OutputSize as Unsigned>::USIZE; // 28
const HASH_LEN_IN_BYTES: usize =
<<Sha224 as OutputSizeUser>::OutputSize as Unsigned>::USIZE; // 28
const MAX_LENGTH_IN_BYTES: usize = Self::HASH_LEN_IN_BYTES + 1; // 29

pub const fn new() -> Self {
Expand Down

0 comments on commit 489398a

Please sign in to comment.