Skip to content
This repository was archived by the owner on Apr 2, 2024. It is now read-only.
/ zlib128.luau Public archive

A simple zlib+base128 string lossless compression module for Roblox luau that uses base128, which has a slightly higher compression rate than zlib91.

Notifications You must be signed in to change notification settings

jiwonz/zlib128.luau

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Note

  • Unlike zlib91.lua, This library does not support pure lua.
  • This library shares almost identical usage with zlib91.lua

Important

  • Since this library uses the base128 function, which is part of rstk's BitBuffer library, due to the operating principle of the bit buffer, it may not be compatible with the general base128(ex. Python base128 library) at all or the data size may be slightly larger.
  • If you want better compatibility, you can also look into zlib91.lua, although it may have some disadvantages as it can grow slightly more data than base128.

Roblox Luau

  • Supports luau type autocompletes
  • (btw, I just personally prefer to use UpperCamelCase with modules for roblox)

import Zlib128 module

local Zlib128 = require(script.zlib128)

Zlib128.compress(data :string, useSingleQuote? :boolean, level :number, strategy :"dynamic"|"fixed"|"huffman_only") -> compressedData :string

local compressedData = Zlib128.compress("example data")

Zlib128.decompress(compressedData :string, useSingleQuote? :boolean) -> decompressedData :string

local decompressedData = Zlib128.decompress(compressedData)

Available strategies:

  • "dynamic"
  • "fixed"
  • "huffman_only"

Credits

About

A simple zlib+base128 string lossless compression module for Roblox luau that uses base128, which has a slightly higher compression rate than zlib91.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages