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

Caesar

func Caesar(s string, shift int) string

Caesar generalizes ROT13 to an arbitrary shift. Negative and large shifts are normalized into [0,26). Only ASCII letters move; anything else passes through unchanged. Caesar(s, 13) is exactly Rot13(s).

Params

Command

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

Result