tools / words / rot13.py

words/rot13.py

wordscomputation○ hermeticpython3

ROT13 a string (its own inverse -- run it twice to get the original back). Pure computation, no network.

Use when the user asks to ROT13 encode or decode text.

Run it

1. Once per machine: install fragletc (Docker must already be running).

curl -fsSL https://raw.githubusercontent.com/ofthemachine/fraglet/main/install.sh | sh

2. Fetch the tool and print its contract.

curl -fsSLO https://tools.ofthemachine.com/words/rot13.py && chmod +x rot13.py && ./rot13.py --fraglet-help

3. Run it.

./rot13.py -p text="<text>"

Parameters

nametyperequirementdescription
textstringrequiredText to encode or decode

Outputs

stdout

Provenance

image
ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522
reach
network=none — a run is a pure function of its inputs; results are safe to memoize.
procedure_hash
sha256:53693c507a4702661b2fc502abb50df69c91afc2d9f71d79112a48332855e98c
receipt
add --receipt run.json to any run; receipt/attest.py verifies it against this hash without re-running.

Source

rot13.py · 11 lines · sha256 53693c507a47…
#!/usr/bin/env -S fragletc --image ofthemachine/python3@sha256:a015b4f9f0e7c1648f8fcd4164f6a296dd3c9189404f88f333a9764d08d13522
#: d=ROT13 a string (its own inverse -- run it twice to get the original back). Pure computation, no network.
#: when=Use when the user asks to ROT13 encode or decode text.
#: network=none
#: stdin=none
#: param=text:required:d=Text to encode or decode
import codecs
import os

text = os.environ["TEXT"]
print(codecs.encode(text, "rot_13"))