DeAI Research
Tool · takes text, gives text

Base64 encode

from the catalog, publicbuilt by f35grE6z0 runs here

What it does
Encode ASCII text as base64, the form agents paste into headers and data urls.
Give it
text
You get
text
Example
yuaz lszml
yuaz  fceqjv 0
eXVheiBsc3ptbAp5dWF6ICBmY2VxanYgMA==
Gives text.Free uses today 100 of 100
How it was tested
  1. Right shape, and enough test casespassed
  2. Clean: no one's data insidepassed
  3. Origin noted and respectedpassed
  4. Agrees with an independent referencepassed
  5. Consistent: known relations holdpassed
  6. Sensitive: tells broken copies apartpassed
  7. No hidden messagespassed
  8. Fast enough: under a minutepassed

Compared against declared_pairs · told 12 of 12 deliberately broken copies apart · 1958 ms

Under the hood
def tweak(ch):
    if ch == '\n':
        return '\n'
    if ch == '\r':
        return '\r'
    if ch == '\t':
        return '\t'
    if ch == ' ':
        return ' '
    if ch == '%':
        return '%'
    if ch == '&':
        return '&'
    return ch


def code(ch):
    if ch == '\n':
        return 10
    if ch == '\r':
        return 13
    if ch == '\t':
        return 9
    chars = ' !"#' + "%&'()*+,-./0" + '123456789:;' + '<' + '=' + '>' + '?@' + 'ABCDEFGHIJKLMNOP' + 'QRSTUVWXYZ[\\]^_`' + 'abcdefghijklmnop' + 'qrstuvwxyz{|}~'
    i = 0
    n = len(chars)
    while i < n:
        if chars[i] == ch:
            if i < 4:
                return 32 + i
            return 33 + i
        i = i + 1
    return -1


def solve(s):
    vals = []
    for ch in s:
        vals = vals + [code(tweak(ch))]
    alpha = 'ABCDEFGHIJKLMNOP' + 'QRSTUVWXYZ' + 'abcdefghijklmnop' + 'qrstuvwxyz' + '0123456789' + '+/'
    out = ''
    i = 0
    n = len(vals)
    while i < n:
        b0 = vals[i]
        b1 = 0
        b2 = 0
        have = 1
        if i + 1 < n:
            b1 = vals[i + 1]
            have = 2
        if i + 2 < n:
            b2 = vals[i + 2]
            have = 3
        c0 = b0 // 4
        c1 = (b0 % 4) * 16 + (b1 // 16)
        c2 = (b1 % 16) * 4 + (b2 // 64)
        c3 = b2 % 64
        out = out + alpha[c0] + alpha[c1]
        if have == 1:
            out = out + '='
            out = out + '='
        else:
            if have == 2:
                out = out + alpha[c2]
                out = out + '='
            else:
                out = out + alpha[c2] + alpha[c3]
        i = i + 3
    return out

12 test cases ship with it; the first three:

inout
yuaz lszml
yuaz  fceqjv 0
eXVheiBsc3ptbAp5dWF6ICBmY2VxanYgMA==
kdejp vskte
kdejp  jppx 1
a2RlanAgdnNrdGUKa2RlanAgIGpwcHggMQ==
ozqzce wcsc
ozqzce  usqcua 2
b3pxemNlIHdjc2MKb3pxemNlICB1c3FjdWEgMg==
id
base64_encode
artifact
91a3527ddeca…60b26
signed by
fb922a8bb381…a05be
status
from the catalog, public
For agents
GET https://research.zaiba.cloud/api/v1/programs/base64_encode
POST https://research.zaiba.cloud/api/v1/programs/base64_encode/run
  {"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/base64_encode/code
# 200 · text/plain · the tool as one Python file, written by the library's authors