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

# crypt.generatebytes

> random byte generator로 임의 바이트를 생성하고 Base64-encoded Lua string으로 반환합니다.

<div className="real-function-page">
  ```lua theme={null}
  crypt.generatebytes(size: number): string
  ```

  ## 인수

  <ParamField path={"size"} type={"number"} required>
    할당 전에 integer conversion를 거치는 숫자입니다. 0 이하 값은 1로 변경됩니다.
  </ParamField>

  ## 반환값

  <ResponseField name={"encoded"} type={"string"}>
    생성된 raw bytes의 Base64 encoding입니다. 반환된 string 길이는 요청한 바이트 수가 아닙니다.
  </ResponseField>

  ## 예제

  raw bytes가 필요할 때 바이트를 생성하고 Base64 결과를 디코드합니다.

  ```lua theme={null}
  local encoded = crypt.generatebytes(16)
  local raw = base64_decode(encoded)

  print(encoded)
  print(#encoded)
  print(#raw)
  ```
</div>
