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

> Генерирует raw random bytes через random byte generator и возвращает их как 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"}>
    Raw generated bytes, возвращаемые как Lua string. Длина возвращенной string совпадает с выделенным числом байтов.
  </ResponseField>

  ## Пример

  Сгенерируйте raw bytes и выведите длину возвращенной Lua string.

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

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