Search Apps Documentation Source Content File Folder Download Copy Actions Download State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

/rot13 package

Overview

Package rot13 ports Go's classic ROT13 example — the one used to teach strings.Map and io.Reader in the standard library docs — to an on-chain Gno realm. The core is a pure letter-rotation cipher over ASCII: ROT13 shifts each letter 13 places, which (since the alphabet has 26 letters) makes ROT13 its own inverse. Caesar generalizes it to any shift.

Everything here is pure strings/unicode logic: no state, no randomness, no clock — Render reads its input straight from the gnoweb path.

Function

Rot13

func Rot13(s string) string

Rot13 applies the ROT13 substitution cipher, rotating ASCII letters by 13 and leaving every other byte untouched. Because 13 is half of 26, Rot13(Rot13(s)) == s — the cipher is its own inverse. This mirrors the canonical strings.Map example from the Go docs.

Param

Command

gnokey query vm/qeval -remote "https://rpc.topaz.testnets.gno.land" -data "gno.land/r/g12cs4cehujpffpjpywmkqj43m6u5ya53nj69sjz/rot13.Rot13()"

Result