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

> Хэширует байты Lua string поддерживаемым алгоритмом crypto library hash и возвращает lowercase hexadecimal digest.

<div className="real-function-page">
  ```lua theme={null}
  crypt.hash(data: string, algorithm?: "sha256" | "sha1" | "sha224" | "sha384" | "sha512" | "md5" | "sha3-224" | "sha3-256" | "sha3-384" | "sha3-512"): string
  ```

  ## Аргументы

  <ParamField path={"data"} type={"string"} required>
    Байты Lua string, передаваемые в crypto library HashFilter.
  </ParamField>

  <ParamField path={"algorithm"} type={"\"sha256\" | \"sha1\" | \"sha224\" | \"sha384\" | \"sha512\" | \"md5\" | \"sha3-224\" | \"sha3-256\" | \"sha3-384\" | \"sha3-512\""}>
    Case-sensitive имя алгоритма hash. Значение по умолчанию sha256.
  </ParamField>

  ## Возвраты

  <ResponseField name={"digest"} type={"string"}>
    Lowercase hexadecimal digest без prefix или separators.
  </ResponseField>

  ## Пример

  Хэшируйте байты Lua string алгоритмом по умолчанию или явно указанным поддерживаемым именем.

  ```lua theme={null}
  local defaultDigest = crypt.hash("hello world")
  local sha3Digest = crypt.hash("hello world", "sha3-256")

  print(defaultDigest)
  print(sha3Digest)
  ```
</div>
