Hashing proc macro utils (#9875)

* hashing macro

* fmt

* use in easy place, and fix blake sizes

* fix

* Fixes, docs.
Allow ident as input.

* fix doc tests

* update error in test (nmapkey and key are same type).

* hashing crates under sp_core

* Doc updates and format.

* use all existing hashing functions.

* return array of u8

* Update primitives/core/hashing/proc-macro/src/impls.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* ToTokeen for an array of u8

* fix

* re

* Improve impls

* complete doc tests

* fmt

* fix doctest format

* fix ui test (nmap key type alias)

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
cheme
2021-11-02 10:35:23 +01:00
committed by GitHub
parent 098815948a
commit 471e9cfbf1
14 changed files with 547 additions and 143 deletions
@@ -0,0 +1,31 @@
[package]
name = "sp-core-hashing"
version = "4.0.0-dev"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
license = "Apache-2.0"
homepage = "https://substrate.dev"
repository = "https://github.com/paritytech/substrate/"
description = "Primitive core crate hashing implementation."
documentation = "https://docs.rs/sp-core-hashing"
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
[dependencies]
sp-std = { version = "4.0.0-dev", default-features = false, path = "../../std" }
byteorder = { version = "1.3.2", default-features = false }
blake2-rfc = { version = "0.2.18", default-features = false }
tiny-keccak = { version = "2.0.1", features = ["keccak"] }
sha2 = { version = "0.9.2", default-features = false }
twox-hash = { version = "1.5.0", default-features = false }
[features]
default = ["std"]
std = [
"blake2-rfc/std",
"sha2/std",
"sp-std/std",
"twox-hash/std",
]