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

> Generuje raw random bytes za pomoca random byte generator i zwraca je jako Lua string.

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

  ## Argumenty

  <ParamField path={"size"} type={"number"} required>
    Liczba przekazywana przez integer conversion przed alokacja. Wartosci mniejsze lub rowne 0 powoduja argument error.
  </ParamField>

  ## Zwroty

  <ResponseField name={"bytes"} type={"string"}>
    Raw generated bytes zwracane jako Lua string. Dlugosc zwroconego string odpowiada zaalokowanej liczbie bajtow.
  </ResponseField>

  ## Przykład

  Wygeneruj raw bytes i wypisz dlugosc zwroconego Lua string.

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

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