Skip to content

Commit

Permalink
move to sha1_smol as the new name for the current library
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Feb 27, 2022
1 parent 5aa53c8 commit 165b7eb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Expand Up @@ -65,7 +65,7 @@ js = ["private_getrandom", "private_getrandom/js"]
rng = ["private_getrandom"]
fast-rng = ["rng", "private_rand"]

sha1 = ["private_sha1"]
sha1 = ["private_sha1_smol"]
md5 = ["private_md-5"]

# Public: Used in trait impls on `Uuid`
Expand Down Expand Up @@ -121,11 +121,11 @@ version = "0.10"
# Private
# Don't depend on this optional feature directly: it may change at any time
# Use the `sha1` feature instead
[dependencies.private_sha1]
package = "sha1"
[dependencies.private_sha1_smol]
package = "sha1_smol"
default-features = false
optional = true
version = "0.10"
version = "1"

# Public: Re-exported
# Don't depend on this optional feature directly: it may change at any time
Expand Down
4 changes: 2 additions & 2 deletions src/sha1.rs
@@ -1,14 +1,14 @@
#[cfg(feature = "v5")]
pub(crate) fn hash(ns: &[u8], src: &[u8]) -> [u8; 16] {
use private_sha1::{Sha1, Digest};
use private_sha1_smol::Sha1;

let mut hasher = Sha1::new();

hasher.update(ns);
hasher.update(src);

let mut bytes = [0; 16];
bytes.copy_from_slice(&hasher.finalize()[..16]);
bytes.copy_from_slice(&hasher.digest().bytes()[..16]);

bytes
}

0 comments on commit 165b7eb

Please sign in to comment.