Stdlib module crypto/hashing.vitl
This page is a wiki-style reference for one concrete stdlib file. It explains what the file owns, where it fits in the family, and how to decide whether this is the right surface to depend on.
crypto/hashing.vitl.Family: crypto
Kind: public stdlib surface
Page style: this reference follows the same “encyclopedic card + portrait + usage contract” logic as the keyword pages, but for stdlib modules.
Summary
Overview
| Field | Value |
|---|---|
| Path | crypto/hashing.vitl |
| Family | crypto |
| Kind | public stdlib surface |
| Line count | 75 |
| Declared procedures | 10 |
| Declared forms/picks | 0 |
`crypto/hashing.vitl` is a public stdlib surface inside the `crypto` family. It should be read as one focused slice of the broader family responsibility: Hashing, HMAC, randomness, key derivation, symmetric primitives, and asymmetric primitives.
Purpose
This file should be chosen because of responsibility, not because its name “sounds close enough”. Inside the crypto family, it carries one focused part of the contract and keeps that responsibility separate from neighboring concerns.
- Use this module when keyed lookup, de-duplication, or stable addressability is part of the program contract.
- A package manifest can be serialized first, then hashed, then optionally signed.
- A token flow can derive a key in one boundary and use it in another without mixing concerns.
Top-level API inventory
| Surface | Items |
|---|---|
| Procedures | sha256_hash, sha512_hash, md5_hash, sha1_hash, blake2b_hash, blake2s_hash, sha3_256_hash, sha3_512_hash, argon2_hash, pbkdf2_hash |
| Forms | none declared at top level |
| Picks | none declared at top level |
| Constants | none declared at top level |
Imported surfaces
This file does not advertise a top-level `use` surface in its opening declarations. That often means it is either self-contained or an aggregation layer.
How to use this module
Start by reading the file as an ownership boundary. Ask three questions: what enters this module, what stable types or procedures it exports, and what adjacent module should stay outside of it.
- Open the family page first to understand why this area of the stdlib exists.
- Read the source excerpt below to see the namespace, imports, and first declared surfaces.
- Check the neighbor list to avoid coupling this module with an adjacent responsibility by habit.
Source shape
space vitte/stdlib/crypto/hashing
proc sha256_hash(text: string) -> string {
let prefix: string = "SHA256("
let body: string = prefix + text
give body + ")"
}
proc sha512_hash(text: string) -> string {
let prefix: string = "SHA512("
let body: string = prefix + text
give body + ")"
The excerpt is not meant to replace the file. It exists to make the module recognizable at first glance, the same way a Wikipedia infobox helps the reader orient before reading the whole article.
Integration boundaries
Within crypto, this file should remain focused. If a future helper changes the host boundary, scheduling boundary, or data-shape boundary, it probably belongs in a neighbor module instead of being added here by convenience.
- Family responsibility: Hashing, HMAC, randomness, key derivation, symmetric primitives, and asymmetric primitives.
- Family architecture role: Use `crypto` when integrity, secrecy, or key management is the feature. This family should never be presented as generic formatting or utility code.