code-hasher 0.1.0

Tiny macro which generates associated constants based on the associated item content
Documentation
  • Coverage
  • 50%
    1 out of 2 items documented1 out of 2 items with examples
  • Size
  • Source code size: 33.66 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 259.34 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 4s Average build duration of successful builds.
  • all releases: 4s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • dusk-network/rusk
    199 66 113
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dusknetwork

Build Status Repository Documentation

code-hasher

Tiny proc macro library designed to hash a code block generating a unique identifier for it which will get written into a const inside of the code block.

Example

#[code_hasher::hash(SOME_CONST_NAME, version = "0.1.0")]
pub mod testing_module {
    pub fn this_does_something() -> [u8; 32] {
        SOME_CONST_NAME
    }
}

Here, SOME_CONST_NAME has assigned as value the resulting hash of:

  • The code contained inside testing_module.
  • The version passed by the user (is optional). Not adding it will basically not hash this attribute and WILL NOT use any default alternatives.

Licensing

This code is licensed under Mozilla Public License Version 2.0 (MPL-2.0). Please see LICENSE for further info.