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

> random byte generator로 raw random bytes를 생성하고 Lua string으로 반환합니다.

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

  ## 인수

  <ParamField path={"size"} type={"number"} required>
    할당 전에 integer conversion를 거치는 숫자입니다. 0 이하 값은 argument error를 발생시킵니다.
  </ParamField>

  ## 반환값

  <ResponseField name={"bytes"} type={"string"}>
    Lua string으로 반환되는 raw generated bytes입니다. 반환된 string 길이는 할당된 바이트 수와 일치합니다.
  </ResponseField>

  ## 예제

  raw bytes를 생성하고 반환된 Lua string 길이를 출력합니다.

  ```lua theme={null}
  local bytes = crypt.random(16)

  print(bytes)
  print(#bytes)
  ```
</div>
