Transaction

9693FDE43D3267…050E65267087

Block 26,357 · index 0 · indexed

Summary

Hash
9693FDE43D3267865F2DB470794C0D08A897B2D4AEF52169DFC5050E65267087
Block
26,357
Size
3790 bytes
Gas used
8,382,050 / 10,058,520
Fee
1000000ugnot
Memo
gnopublish
Status
success

Messages

Arguments · 9

  1. #1hexdumpdemo
  2. #2README.md
  3. #3# `gno.land/r/moul/x/daily/hexdumpdemo/v0` **Live demo of [`p/moul/x/daily/hexdump`](https://github.com/moul/gno-contracts/tree/main/p/moul/x/daily/hexdump/v0).** A thin, stateless realm: it holds no state of its own and contains none of the library's logic — `Render` just exercises the package and shows the result. Because it is stateless, the rendered page is identical on every call and on every node. Render it at [`/r/moul/x/daily/hexdumpdemo/v0`](https://gno.land/r/moul/x/daily/hexdumpdemo/v0). The library README explains the design and the trade-offs; this realm is the worked example. <!-- BEGIN GNOCONTRACTS FOOTER (generated by `make readmes`; do not edit below) --> --- Part of **[moul/gno-contracts](https://github.com/moul/gno-contracts)** — moul's versioned gno.land contracts. See the repository for the full catalog, build/test tooling, and usage. **Dependency graph:** ![gno.land/r/moul/x/daily/hexdumpdemo/v0 dependency graph](https://raw.githubusercontent.com/moul/gno-contracts/main/_assets/gno.land/r/moul/x/daily/hexdumpdemo/v0/deps.png) > 🧪 **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](https://github.com/moul/gno-contracts/blob/main/DISCLAIMER.md). <!-- END GNOCONTRACTS FOOTER -->
  4. #4gnomod.toml
  5. #5module = "gno.land/r/moul/x/daily/hexdumpdemo/v0" gno = "0.9"
  6. #6hexdumpdemo.gno
  7. #7// Package hexdumpdemo is a small gnoweb demo of the xxd-style byte dump // provided by the [p/moul/x/daily/hexdump](/p/moul/x/daily/hexdump/v0) // library: it shows what a rendered string hides. // // It contains no formatting logic of its own. Stateless, so Render is // deterministic — which is precisely what the library is for. package hexdumpdemo import ( "strconv" "strings" "gno.land/p/moul/x/daily/hexdump/v0" ) // Render renders the demo for gnoweb. func Render(path string) string { var b strings.Builder b.WriteString("# Hexdump\n\n") b.WriteString("Bytes in the classic `xxd -C` layout, demoing the ") b.WriteString("[`p/moul/x/daily/hexdump`](/p/moul/x/daily/hexdump/v0) library.\n\n") b.WriteString("## A plain string\n\n") dump("Hello, gno.land!", &b) b.WriteString("\n## Alignment on a partial line\n\n") b.WriteString("The last line is short, so the hex columns are padded and the ASCII ") b.WriteString("gutter stays put — that alignment is the whole point of the layout.\n\n") dump("0123456789abcdefhi", &b) b.WriteString("\n## What a rendered string hides\n\n") b.WriteString("These two look identical in any UI:\n\n") b.WriteString("- `\"hi\"`\n- `\"hi \"` — one trailing space\n\n") dump("hi", &b) b.WriteString("\n") dump("hi ", &b) b.WriteString("\n## Multi-byte UTF-8\n\n") b.WriteString("`\"café\"` is 5 bytes, not 4: `é` is `c3 a9`. Non-printables render as `.`.\n\n") dump("café", &b) b.WriteString("\n## Control characters\n\n") b.WriteString("A NUL, a newline and a tab are invisible in text and obvious here.\n\n") out, n := hexdump.Dump([]byte{0x00, 0x0a, 0x09, 'o', 'k'}) b.WriteString("```\n" + out + "```\n\n") b.WriteString("_" + strconv.Itoa(n) + " bytes._\n") return b.String() } func dump(s string, b *strings.Builder) { out, n := hexdump.DumpString(s) b.WriteString("```\n" + out + "```\n") b.WriteString("\n_`" + s + "` → " + strconv.Itoa(n) + " bytes._\n") }
  8. #8/gno.MemPackageType
  9. #9 MPUserProd

Result log

msg:0,success:true,log:,events:[]

← Back to block 26,357