Hash utilities are a compatibility compromise: they let HeavenBase use normal string IDs while keeping some hashes integer-like and sortable when an index benefits from that shape.
1. Core Idea
HeavenBase often needs identifiers that behave like strings because they move through JSON, database rows, object IDs, and filenames. It also sometimes benefits from values that can be interpreted as integers for ordering, bucket assignment, or index-friendly storage.md5hash(...) currently returns a zero-padded decimal string. That means it can live as a normal string ID, but same-length values also sort like their integer representation.
This is not settled as a universal design. The integer-able string hash is a practical compatibility move for the current pre-release, not a claim that every external API should depend on this exact representation.
2. Create a Stable ID
md5hash(...) serializes common Python values with stable JSON ordering and returns a zero-padded decimal string. The default length is 42, which matches HeavenBase’s identifier-friendly hash width.
hash_id(...) when an ID should carry a logical namespace:
3. Bucket or Order Values
Use integer digests when modulo arithmetic, deterministic sampling, or ordering needs a number.md5int(...) is shorter and fast enough for local utility IDs. sha256int(...) is useful when a wider digest makes the intent clearer.
4. Fingerprint Larger Payloads
Usesha256hash(...) for hex fingerprints in manifests, config snapshots, and integrity checks.
These helpers are deterministic utility hashes, not authentication or password-storage primitives.

