Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

v0 source realm

Package sha1demo is a small gnoweb demo of the SHA-1 implementation provided by the [p/moul/x/daily/sha1](/p/moul/x/d...

Readme View source

SHA-1

⚠️ Experimental, generated with no human supervision by the daily pipeline to exercise gno tooling. Not audited. See r/moul/x/daily.


Shows the published SHA-1 vectors, the git object ids anyone can check from a terminal, HMAC answers starting with RFC 2202 test case 2, and hashes whatever you put in the path, slashes and spaces included.

/r/moul/x/daily/sha1demo/v0        → the vector tables
/r/moul/x/daily/sha1demo/v0:abc    → hash your own text

Demo of the p/moul/x/daily/sha1 library, with no hashing logic of its own. Stateless, so Render is deterministic and the pinned example doubles as a conformance test: a wrong digit anywhere in the library fails it.

The git rows are the ones worth checking by hand. printf 'hello world\n' | git hash-object --stdin prints the same 3b18e512... the page does, because git names a blob by the SHA-1 of blob <len>\x00<content> rather than of the content.

SHA-1 is broken for collisions and the page says so: it is here for the formats that specify it, not as something to protect anything with.

Built for gno 0.9.


Part of moul/gno-contracts — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage.

On mainnet: deployment status transactions unique callers deployed revision

Dependency graph:

gno.land/r/moul/x/daily/sha1demo/v0 dependency graph

🧪 Highly experimental — potentially vibe-coded. Not audited; may break, change, or be removed at any time. Do not use with anything of value. Full disclaimer: DISCLAIMER.

Overview

Package sha1demo is a small gnoweb demo of the SHA-1 implementation provided by the p/moul/x/daily/sha1(/p/moul/x/daily/sha1/v0) library: the published test vectors, the git object ids anyone can check with `git hash-object`, HMAC answers led by RFC 2202 test case 2, and a path that hashes whatever you give it.

It contains no hashing logic of its own. Stateless, so Render is deterministic.

Functions 1

func Render

1func Render(path string) string
source

Render renders the demo for gnoweb.

Example
1Render("")       / Render("/") -> the vector tables
2Render("/<text>")              -> hash that text

Dependencies

Source Files 3