You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NOTE: the [BLAKE3 crate](https://github.com/BLAKE3-team/BLAKE3) implements the `digest` traits used by the rest of the hashes in this repository, but is maintained by the BLAKE3 team.
34
+
NOTE: the [`blake3`] crate implements the `digest` traits used by the rest of the hashes in this repository, but is maintained by the BLAKE3 team.
Whenever possible crates are published under the the same name as the crate folder.
42
-
Owners of `md5` and `sha1` declined ([1](https://github.com/stainless-steel/md5/pull/2), [2](https://github.com/mitsuhiko/rust-sha1/issues/17)) to participate in this project.
43
-
Those crates do not implement the [`digest`] traits, so they are not interoperable with the RustCrypto ecosystem.
44
-
This is why crates marked by :exclamation: are published under `md-5` and `sha-1` names, but the libraries themselves are named as `md5` and `sha1`, i.e. inside `use` statements you should use `sha1`/`md5`, not `sha_1`/`md_5`.
42
+
Owners of `md5`[declined](https://github.com/stainless-steel/md5/pull/) to participate in this project.
43
+
This crate does not implement the [`digest`] traits, so it is not interoperable with the RustCrypto ecosystem.
44
+
This is why we publish our MD5 implementation as `md-5` and mark it with the :exclamation: mark.
45
+
Note that the library itselv is named as `md5`, i.e. inside `use` statements you should use `md5`, not `md_5`.
46
+
47
+
The SHA-1 implementation was previosuly published as `sha-1`, but migrated to `sha1` since v0.10.0.
48
+
`sha-1` will continue to recieve v0.10.x patch updates, but will be deprecated after `sha1` v0.11 release.
45
49
46
50
### Security Level Legend
47
51
@@ -92,12 +96,22 @@ hasher.update(data);
92
96
hasher.update("String data");
93
97
// Note that calling `finalize()` consumes hasher
94
98
lethash=hasher.finalize();
95
-
println!("Result: {:x}", hash);
99
+
println!("Binary hash: {:?}", hash);
96
100
```
97
101
98
102
In this example `hash` has type `GenericArray<u8, U32>`, which is a generic alternative to `[u8; 32]` defined in the [`generic-array`] crate.
103
+
If you need to serialize hash value into string, you can use crates like [`base16ct`] and [`base64ct`]:
104
+
```rust
105
+
usebase64ct::{Base64, Encoding};
106
+
107
+
letbase64_hash=Base64::encode_string(&hash);
108
+
println!("Base64-encoded hash: {}", hex_hash);
99
109
100
-
Alternatively, you can use a chained approach, which is equivalent to the previous example:
Copy file name to clipboardExpand all lines: sha1/CHANGELOG.md
+3-96Lines changed: 3 additions & 96 deletions
Original file line number
Diff line number
Diff line change
@@ -5,101 +5,8 @@ All notable changes to this project will be documented in this file.
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
8
-
## 0.10.0 (2021-12-07)
8
+
## 0.10.0 (2022-01-17)
9
9
### Changed
10
-
-Update to `digest` v0.10([#217])
10
+
-The crate is transferred to the RustCrypto organization. New implementation is identical to the `sha-1 v0.10.0` crate and expressed in terms of traits from the `digest` crate. ([#350])
0 commit comments