> ## 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.

# lz4compress

> Lua string 바이트를 LZ4 block compression로 압축하고 raw compressed bytes를 Lua string으로 반환합니다.

<div className="real-function-page">
  ```lua theme={null}
  lz4compress(data: string): string
  ```

  ## 별칭

  * `crypt.lz4compress`
  * `crypt.lz4.compress`
  * `lz4.compress`

  ## 인수

  <ParamField path={"data"} type={"string"} required>
    LZ4 block compression에 전달되는 Lua string 바이트입니다.
  </ParamField>

  ## 반환값

  <ResponseField name={"compressed"} type={"string"}>
    Lua string으로 반환되는 raw compressed bytes입니다. original size는 출력에 저장되지 않습니다.
  </ResponseField>

  ## 예제

  Lua string 바이트를 압축하고 original size를 전달해 복원합니다.

  ```lua theme={null}
  local source = string.rep("Real Docs ", 100)
  local compressed = lz4compress(source)
  local restored = lz4decompress(compressed, #source)

  print(#source, #compressed, restored == source)
  ```
</div>
