
Does it work?
No reports yetNo reports yet. Tried it? Be the first to say.
Description
cJSON is a script that helps developers reduce file sizes, whethere it is beautified JSON, JSON that was obtained from websites via pretty print, or just any JSON data. It uses simple techniques to compress text, such as sequences of the same letter with 4 bytes, 2 bytes to mark the compression, 1 to mark how many times to duplicate it, and 1 aka the original letter. Of course it only does that IF the 4 bytes are shorter than the original sequence, so it wont work for 3 letter and below sequences. It also uses base62 encoding for numbers to decrease their sizes! For example, take the number 1234567890, base62 converts it to 1ly7vk which is only 6 bytes (4 bytes shorter than the actual number), And then you can add 2 to the total length which marks the string as base62 encoded. Usage: cJ:Compress(Data: string): table -> {BytesCompressed: number = 0, Result: string = "", TimeTaken: float = 0.000000} cJ:Decompress(Data: string): string -> Decompresses already compressed cJSON. Feel free to DM me about any issues on my discord.
-- cJSON: A new file extension which stands for compressed json.
local gsub, format, rep, sub, split, match, gmatch = string.gsub, string.format, string.rep, string.sub, string.split, string.match, string.gmatch;
local tinsert = table.insert;
local floor = math.floor;
local tostring, tonumber = tostring, tonumber;
-- * Base62 Start (Useful for number compression.)
local base62_chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
local base62 = { -- Very useful for compressing numbers, Can reduce sizes heavily when handling big numbers, for example: 1234567890 (#10) -> 1ly7vk (#6) which is 4 bytes shorter.
index = {};
}
for i = 1, #base62_chars do
base62.index[sub(base62_chars, i, i)] = i - 1
end
function base62.encode(num)
local str = tostring(num);
if #str == 1 then return str end -- Numbers like 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 always return "(number)" so we can just do that.
num = tonumber(num);
local result = ""
while num > 0 do
local remainder = num % 62
result = sub(base62_chars, remainder + 1, remainder + 1) .. result
num = floor(num / 62)
end
return result
end
function base62.decode(str)
local result = 0
for i = 1, #str do
local char = sub(str, i, i)
cJSON








those flowers, are just not needed :sob:
@frzfrsy 🥷 WHO are you
@vxsty indian new exploiter, music producer
@frzfrsy the project is over a year old so please read the code before commenting anything (And it's still better than anything you can currently make!)
@lelahcolonial453 ??? i made this on roblox studio, chatgpt does not give you such scripts, but since you seem to be experienced with chatgpt make him generate it
@lelahcolonial453 ???? read the code buddy
@vxsty "please code the script without comments and the ugliest the possible but works" 💔💔
Lmao chatgpt made this