Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added dependency shim for old sha1 crate (#41)
- Loading branch information
Showing
6 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/target | ||
/Cargo.lock |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "sha1" | ||
version = "0.6.1" | ||
authors = ["Armin Ronacher <armin.ronacher@active-4.com>"] | ||
keywords = ["sha1"] | ||
description = "Minimal dependency free implementation of SHA1 for Rust." | ||
license = "BSD-3-Clause" | ||
repository = "https://github.com/mitsuhiko/sha1-smol" | ||
edition = "2018" | ||
|
||
[features] | ||
std = ["sha1_smol/std"] | ||
serde = ["sha1_smol/serde"] | ||
|
||
[dependencies] | ||
sha1_smol = "1.0.0" | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
//! A minimal implementation of SHA1 for rust. | ||
//! | ||
//! This implementation supports no_std which is the default mode. The | ||
//! following features are available and can be optionally enabled: | ||
//! | ||
//! * ``serde``: when enabled the `Digest` type can be serialized. | ||
//! * ``std``: when enabled errors from this library implement `std::error::Error` | ||
//! and the `hexdigest` shortcut becomes available. | ||
//! | ||
//! **Note:** future versions of this crate with the old code are now under | ||
//! `sha1_smol`, the `sha1` crate name with versions beyond the 0.6 line now | ||
//! refer to the `RustCrypto` implementation. | ||
//! | ||
//! ## Example | ||
//! | ||
//! ```rust | ||
//! # fn main() { | ||
//! | ||
//! let mut m = sha1_smol::Sha1::new(); | ||
//! m.update(b"Hello World!"); | ||
//! assert_eq!(m.digest().to_string(), | ||
//! "2ef7bde608ce5404e97d5f042f95f89f1c232871"); | ||
//! # } | ||
//! ``` | ||
//! | ||
//! The sha1 object can be updated multiple times. If you only need to use | ||
//! it once you can also use shortcuts (requires std): | ||
//! | ||
//! ``` | ||
//! # trait X { fn hexdigest(&self) -> &'static str { "2ef7bde608ce5404e97d5f042f95f89f1c232871" }} | ||
//! # impl X for sha1_smol::Sha1 {} | ||
//! # fn main() { | ||
//! assert_eq!(sha1_smol::Sha1::from("Hello World!").hexdigest(), | ||
//! "2ef7bde608ce5404e97d5f042f95f89f1c232871"); | ||
//! # } | ||
//! ``` | ||
|
||
pub use sha1_smol::*; |