Skip to content

Latest commit

 

History

History
41 lines (41 loc) · 1.45 KB

README.md

File metadata and controls

41 lines (41 loc) · 1.45 KB

Note

  • this module originally created for Roblox. so Pure lua version can be less stable.

Pure Lua

import zlib91 module

local zlib91 = require("zlib91")

zlib91.compress(data :string, useSingleQuote :boolean, level :number, strategy :string) -> compressedData :string

  • useSingleQuote default: false
  • level default: 6
  • strategy default: dynamic
local compressedData = zlib91.compress("example data")

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

  • useSingleQuote default: false
local decompressedData = zlib91.decompress(compressedData)

Available strategies:

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

Roblox Luau

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

import Zlib91 module

local Zlib91 = require(script.zlib91)

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

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

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

local decompressedData = Zlib91.decompress(compressedData)

Credits