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

<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"}>
    Base64 encoding للبايتات الخام التي تم إنشاؤها. طول السلسلة المعادة ليس عدد البايتات المطلوب.
  </ResponseField>

  ## مثال

  انشئ بايتات وفك نتيجة Base64 عندما تحتاج إلى البايتات الخام.

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

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