Skip to content

Commit

Permalink
update hasher
Browse files Browse the repository at this point in the history
  • Loading branch information
UMR1352 committed Dec 17, 2024
1 parent bcaac2f commit a5b2991
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hasher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub const SHA_ALG_NAME: &str = "sha-256";
/// Implementations of this trait are expected only for algorithms listed in
/// the IANA "Named Information Hash Algorithm" registry.
/// See [Hash Function Claim](https://www.ietf.org/archive/id/draft-ietf-oauth-selective-disclosure-jwt-07.html#name-hash-function-claim)
pub trait Hasher: Sync + Send {
pub trait Hasher {
/// Digests input to produce unique fixed-size hash value in bytes.
fn digest(&self, input: &[u8]) -> Vec<u8>;

Expand All @@ -27,7 +27,7 @@ pub trait Hasher: Sync + Send {
///
/// The hash algorithm identifier MUST be a hash algorithm value from the
/// "Hash Name String" column in the IANA "Named Information Hash Algorithm"
fn alg_name(&self) -> &'static str;
fn alg_name(&self) -> &str;

/// Returns the base64url-encoded digest of a `disclosure`.
fn encoded_digest(&self, disclosure: &str) -> String {
Expand Down

0 comments on commit a5b2991

Please sign in to comment.