Skip to content

Commit

Permalink
Merge pull request #7 from baoyachi/refactor_code
Browse files Browse the repository at this point in the history
fix &[u8] impl Sha256Digest
  • Loading branch information
baoyachi authored Oct 17, 2022
2 parents 827220d + f7f0b0c commit f2653e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sha256"
version = "1.1.0"
version = "1.1.1"
authors = ["baoyachi <[email protected]>"]
edition = "2018"
description = "sha256 crypto digest"
Expand Down
6 changes: 6 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ impl<const N: usize> Sha256Digest for &[u8; N] {
}
}

impl Sha256Digest for &[u8] {
fn digest(self) -> String {
__digest__(self)
}
}

impl Sha256Digest for String {
fn digest(self) -> String {
__digest__(self.as_bytes())
Expand Down

0 comments on commit f2653e8

Please sign in to comment.