> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# lz4decompress

> Decompresses raw LZ4 block bytes with LZ4 block decompression and returns raw decompressed bytes as a Lua string.

<div className="real-function-page">
  ```lua theme={null}
  lz4decompress(data: string, originalSize?: number): string
  ```

  ## Aliases

  * `crypt.lz4decompress`
  * `crypt.lz4.decompress`
  * `lz4.decompress`

  ## Arguments

  <ParamField path={"data"} type={"string"} required>
    Raw compressed bytes passed to LZ4 block decompression.
  </ParamField>

  <ParamField path={"originalSize"} type={"number"}>
    Output buffer size passed as dstCapacity. For lz4compress output, pass the original uncompressed byte length; when omitted, the compressed input length is used.
  </ParamField>

  ## Returns

  <ResponseField name={"decompressed"} type={"string"}>
    Raw decompressed bytes returned as a Lua string. The output can be shorter than originalSize.
  </ResponseField>

  ## Example

  Decompress LZ4 bytes by passing the original uncompressed size.

  ```lua theme={null}
  local source = "Real Docs"
  local compressed = lz4compress(source)
  local decompressed = lz4decompress(compressed, #source)

  print(decompressed)
  print(decompressed == source)
  ```
</div>
