Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dependency shim for old sha1 crate #41

Merged
merged 1 commit into from Jan 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions legacy-shim/.gitignore
@@ -0,0 +1,2 @@
/target
/Cargo.lock
25 changes: 25 additions & 0 deletions legacy-shim/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions legacy-shim/Cargo.toml
@@ -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
1 change: 1 addition & 0 deletions legacy-shim/LICENSE
1 change: 1 addition & 0 deletions legacy-shim/README.md
38 changes: 38 additions & 0 deletions legacy-shim/src/lib.rs
@@ -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::*;