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

Dedicated HashValue type to make it less ambiguous working with hashes #13

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ mod c2_blockchain;
mod c3_consensus;
mod c4_framework;

//TODO This is just me scribbling a quick little idea to disambiguate the hash type throughout this project.
/// A Simple 64-bit hash value that will be used whenever a cryptographic hash is needed.
pub struct HashValue(u64);

// Simple helper to do some hashing.
fn hash<T: Hash>(t: &T) -> u64 {
let mut s = DefaultHasher::new();
Expand Down