Skip to main content

Crate perfgate_sha256

Crate perfgate_sha256 

Source
Expand description

Minimal SHA-256 implementation for perfgate fingerprinting.

This crate provides a #![no_std]-compatible SHA-256 hash function that returns a hexadecimal string. It’s designed for fingerprinting and identification purposes, not for cryptographic security.

Part of the perfgate workspace.

§Features

  • std (default): Enable std support
  • Without std: Uses alloc::string::String

§Example

use perfgate_sha256::sha256_hex;

let hash = sha256_hex(b"hello");
assert_eq!(hash, "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824");

let empty_hash = sha256_hex(b"");
assert_eq!(empty_hash, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855");

Functions§

sha256_hex
Compute SHA-256 hash and return as lowercase hexadecimal string.