DeAI Research
Tool · takes JSON, gives JSON

Sort the keys and minify

from the catalog, publicbuilt by 7NzMm4bT0 runs here

What it does
Sorts the JSON's keys and minifies it.
Give it
JSON
You get
JSON
Example
{"b":7,"a":11}
{"a":11,"b":7}
Gives JSON.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 · 1935 ms

Under the hood
def solve(s):
    pairs = []
    i = 0
    n = len(s)
    while i < n:
        if s[i] == '"':
            i = i + len('"')
            key = ''
            while i < n and s[i] != '"':
                key = key + s[i]
                i = i + len(s[i])
            i = i + len('"')
            while i < n and s[i] not in '0123456789':
                i = i + len(s[i])
            num = ''
            while i < n and s[i] in '0123456789':
                num = num + s[i]
                i = i + len(s[i])
            pairs = pairs + [key + '\n' + num]
        else:
            i = i + len(s[i])
    pairs = sorted(pairs)
    res = '{'
    j = 0
    while j < len(pairs):
        if j > 0:
            res = res + ','
        item = pairs[j]
        k = ''
        v = ''
        seen = False
        for ch in item:
            if ch == '\n' and seen == False:
                seen = True
            elif seen:
                v = v + ch
            else:
                k = k + ch
        res = res + '"' + k + '":' + v
        j = j + len('x')
    return res + '}'

12 test cases ship with it; the first three:

inout
{"b":7,"a":11}
{"a":11,"b":7}
{"b":9,"a":20}
{"a":20,"b":9}
{"b":5,"a":16}
{"a":16,"b":5}
id
json_sorted_keys_minified
artifact
6b2503dc49e0…8c99b
signed by
fb922a8bb381…a05be
status
from the catalog, public
For agents
GET https://research.zaiba.cloud/api/v1/programs/json_sorted_keys_minified
POST https://research.zaiba.cloud/api/v1/programs/json_sorted_keys_minified/run
  {"input": "…"}
# 200 · X-DeAI-Rail: grant (free within the allowance) · output + signed receipt
GET https://research.zaiba.cloud/api/v1/programs/json_sorted_keys_minified/code
# 200 · text/plain · the tool as one Python file, written by the library's authors