{
  "classes": [
    {
      "constants": [
        {
          "name": "VERSION_10",
          "value": "16",
          "owner": "argon2",
          "group_title": "Argon2 version 1.0 (`0x10`).\n\nThis is mostly useful for interoperability with old hashes.\n",
          "desc": ""
        },
        {
          "name": "VERSION_13",
          "value": "19",
          "owner": "argon2",
          "group_title": "Argon2 version 1.3 (`0x13`), the modern version used in most contexts.\n",
          "desc": ""
        },
        {
          "name": "VERSION_NUMBER",
          "value": "19",
          "owner": "argon2",
          "group_title": "The default Argon2 version used by this module.\n",
          "desc": ""
        }
      ],
      "types": [
        {
          "lua_type": "type Version = number",
          "name": "Version",
          "tags": [],
          "source": {
            "path": "",
            "line": 39
          },
          "fields": [],
          "desc": ""
        }
      ],
      "name": "@eryx/crypto/hazmat/argon2",
      "tags": [],
      "functions": [
        {
          "source": {
            "path": "",
            "line": 60
          },
          "is_method": false,
          "signature": "argon2.argon2d_hash_raw(\n    password: buffer,  -- Password or secret to hash.\n    salt: buffer,  -- Unique salt. Argon2 requires at least 8 bytes; 16+ bytes is a sensible default.\n    time_cost: number,  -- Number of passes over memory.\n    memory_kib: number,  -- Memory cost in KiB.\n    parallelism: number,  -- Number of lanes/threads to request.\n    hash_len: number,  -- Desired raw output length in bytes.\n    version: Version?  -- Argon2 version. Defaults to [[VERSION_NUMBER]].\n) → (\n    buffer  -- Raw hash output. \n)",
          "owner": "argon2",
          "desc": "Hashes a password with Argon2d and returns the raw hash bytes.\n\nArgon2d uses data-dependent memory access, making it a poor default\nfor password hashing on shared hardware, but it can be useful for\nspecialised proof-of-work or side-channel-free environments.\n",
          "tags": [],
          "name": "argon2d_hash_raw",
          "return_str": "buffer",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Raw hash output. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "password",
              "desc": "Password or secret to hash."
            },
            {
              "lua_type": "buffer",
              "name": "salt",
              "desc": "Unique salt. Argon2 requires at least 8 bytes; 16+ bytes is a sensible default."
            },
            {
              "lua_type": "number",
              "name": "time_cost",
              "desc": "Number of passes over memory."
            },
            {
              "lua_type": "number",
              "name": "memory_kib",
              "desc": "Memory cost in KiB."
            },
            {
              "lua_type": "number",
              "name": "parallelism",
              "desc": "Number of lanes/threads to request."
            },
            {
              "lua_type": "number",
              "name": "hash_len",
              "desc": "Desired raw output length in bytes."
            },
            {
              "lua_type": "Version?",
              "name": "version",
              "desc": "Argon2 version. Defaults to [[VERSION_NUMBER]]."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 88
          },
          "is_method": false,
          "signature": "argon2.argon2i_hash_raw(\n    password: buffer,  -- Password or secret to hash.\n    salt: buffer,  -- Unique salt.\n    time_cost: number,  -- Number of passes over memory.\n    memory_kib: number,  -- Memory cost in KiB.\n    parallelism: number,  -- Number of lanes/threads to request.\n    hash_len: number,  -- Desired raw output length in bytes.\n    version: Version?  -- Argon2 version. Defaults to [[VERSION_NUMBER]].\n) → (\n    buffer  -- Raw hash output. \n)",
          "owner": "argon2",
          "desc": "Hashes a password with Argon2i and returns the raw hash bytes.\n\nArgon2i uses data-independent memory access and is safer in the\npresence of timing/cache-observation attacks, but it is usually not\nthe first choice now that Argon2id exists.\n",
          "tags": [],
          "name": "argon2i_hash_raw",
          "return_str": "buffer",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Raw hash output. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "password",
              "desc": "Password or secret to hash."
            },
            {
              "lua_type": "buffer",
              "name": "salt",
              "desc": "Unique salt."
            },
            {
              "lua_type": "number",
              "name": "time_cost",
              "desc": "Number of passes over memory."
            },
            {
              "lua_type": "number",
              "name": "memory_kib",
              "desc": "Memory cost in KiB."
            },
            {
              "lua_type": "number",
              "name": "parallelism",
              "desc": "Number of lanes/threads to request."
            },
            {
              "lua_type": "number",
              "name": "hash_len",
              "desc": "Desired raw output length in bytes."
            },
            {
              "lua_type": "Version?",
              "name": "version",
              "desc": "Argon2 version. Defaults to [[VERSION_NUMBER]]."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 115
          },
          "is_method": false,
          "signature": "argon2.argon2id_hash_raw(\n    password: buffer,  -- Password or secret to hash.\n    salt: buffer,  -- Unique salt.\n    time_cost: number,  -- Number of passes over memory.\n    memory_kib: number,  -- Memory cost in KiB.\n    parallelism: number,  -- Number of lanes/threads to request.\n    hash_len: number,  -- Desired raw output length in bytes.\n    version: Version?  -- Argon2 version. Defaults to [[VERSION_NUMBER]].\n) → (\n    buffer  -- Raw hash output. \n)",
          "owner": "argon2",
          "desc": "Hashes a password with Argon2id and returns the raw hash bytes.\n\nArgon2id is the recommended general-purpose Argon2 mode for password\nhashing.\n",
          "tags": [],
          "name": "argon2id_hash_raw",
          "return_str": "buffer",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Raw hash output. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "password",
              "desc": "Password or secret to hash."
            },
            {
              "lua_type": "buffer",
              "name": "salt",
              "desc": "Unique salt."
            },
            {
              "lua_type": "number",
              "name": "time_cost",
              "desc": "Number of passes over memory."
            },
            {
              "lua_type": "number",
              "name": "memory_kib",
              "desc": "Memory cost in KiB."
            },
            {
              "lua_type": "number",
              "name": "parallelism",
              "desc": "Number of lanes/threads to request."
            },
            {
              "lua_type": "number",
              "name": "hash_len",
              "desc": "Desired raw output length in bytes."
            },
            {
              "lua_type": "Version?",
              "name": "version",
              "desc": "Argon2 version. Defaults to [[VERSION_NUMBER]]."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 142
          },
          "is_method": false,
          "signature": "argon2.argon2d_hash_encoded(\n    password: buffer,  -- Password or secret to hash.\n    salt: buffer,  -- Unique salt.\n    time_cost: number,  -- Number of passes over memory.\n    memory_kib: number,  -- Memory cost in KiB.\n    parallelism: number,  -- Number of lanes/threads to request.\n    hash_len: number,  -- Desired raw output length in bytes.\n    version: Version?  -- Argon2 version. Defaults to [[VERSION_NUMBER]].\n) → (\n    string  -- Encoded Argon2 hash string. \n)",
          "owner": "argon2",
          "desc": "Hashes a password with Argon2d and returns the PHC encoded string.\n\nThis is the storage-friendly string form containing the variant,\nversion, cost parameters, salt, and hash.\n",
          "tags": [],
          "name": "argon2d_hash_encoded",
          "return_str": "string",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Encoded Argon2 hash string. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "password",
              "desc": "Password or secret to hash."
            },
            {
              "lua_type": "buffer",
              "name": "salt",
              "desc": "Unique salt."
            },
            {
              "lua_type": "number",
              "name": "time_cost",
              "desc": "Number of passes over memory."
            },
            {
              "lua_type": "number",
              "name": "memory_kib",
              "desc": "Memory cost in KiB."
            },
            {
              "lua_type": "number",
              "name": "parallelism",
              "desc": "Number of lanes/threads to request."
            },
            {
              "lua_type": "number",
              "name": "hash_len",
              "desc": "Desired raw output length in bytes."
            },
            {
              "lua_type": "Version?",
              "name": "version",
              "desc": "Argon2 version. Defaults to [[VERSION_NUMBER]]."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 166
          },
          "is_method": false,
          "signature": "argon2.argon2i_hash_encoded(\n    password: buffer,  -- Password or secret to hash.\n    salt: buffer,  -- Unique salt.\n    time_cost: number,  -- Number of passes over memory.\n    memory_kib: number,  -- Memory cost in KiB.\n    parallelism: number,  -- Number of lanes/threads to request.\n    hash_len: number,  -- Desired raw output length in bytes.\n    version: Version?  -- Argon2 version. Defaults to [[VERSION_NUMBER]].\n) → (\n    string  -- Encoded Argon2 hash string. \n)",
          "owner": "argon2",
          "desc": "Hashes a password with Argon2i and returns the PHC encoded string.\n",
          "tags": [],
          "name": "argon2i_hash_encoded",
          "return_str": "string",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Encoded Argon2 hash string. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "password",
              "desc": "Password or secret to hash."
            },
            {
              "lua_type": "buffer",
              "name": "salt",
              "desc": "Unique salt."
            },
            {
              "lua_type": "number",
              "name": "time_cost",
              "desc": "Number of passes over memory."
            },
            {
              "lua_type": "number",
              "name": "memory_kib",
              "desc": "Memory cost in KiB."
            },
            {
              "lua_type": "number",
              "name": "parallelism",
              "desc": "Number of lanes/threads to request."
            },
            {
              "lua_type": "number",
              "name": "hash_len",
              "desc": "Desired raw output length in bytes."
            },
            {
              "lua_type": "Version?",
              "name": "version",
              "desc": "Argon2 version. Defaults to [[VERSION_NUMBER]]."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 192
          },
          "is_method": false,
          "signature": "argon2.argon2id_hash_encoded(\n    password: buffer,  -- Password or secret to hash.\n    salt: buffer,  -- Unique salt.\n    time_cost: number,  -- Number of passes over memory.\n    memory_kib: number,  -- Memory cost in KiB.\n    parallelism: number,  -- Number of lanes/threads to request.\n    hash_len: number,  -- Desired raw output length in bytes.\n    version: Version?  -- Argon2 version. Defaults to [[VERSION_NUMBER]].\n) → (\n    string  -- Encoded Argon2 hash string. \n)",
          "owner": "argon2",
          "desc": "Hashes a password with Argon2id and returns the PHC encoded string.\n\nThis is the usual API you want for password storage.\n",
          "tags": [],
          "name": "argon2id_hash_encoded",
          "return_str": "string",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Encoded Argon2 hash string. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "password",
              "desc": "Password or secret to hash."
            },
            {
              "lua_type": "buffer",
              "name": "salt",
              "desc": "Unique salt."
            },
            {
              "lua_type": "number",
              "name": "time_cost",
              "desc": "Number of passes over memory."
            },
            {
              "lua_type": "number",
              "name": "memory_kib",
              "desc": "Memory cost in KiB."
            },
            {
              "lua_type": "number",
              "name": "parallelism",
              "desc": "Number of lanes/threads to request."
            },
            {
              "lua_type": "number",
              "name": "hash_len",
              "desc": "Desired raw output length in bytes."
            },
            {
              "lua_type": "Version?",
              "name": "version",
              "desc": "Argon2 version. Defaults to [[VERSION_NUMBER]]."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 214
          },
          "is_method": false,
          "signature": "argon2.verify_encoded(\n    encoded: string,  -- Encoded PHC hash string.\n    password: buffer  -- Password to test.\n) → (\n    boolean  -- `true` if the password matches. \n)",
          "owner": "argon2",
          "desc": "Verifies a password against an encoded Argon2 hash string.\n\nThe variant is inferred from the encoded PHC prefix, so the same\nfunction works for Argon2d, Argon2i, and Argon2id encoded hashes.\n",
          "tags": [],
          "name": "verify_encoded",
          "return_str": "boolean",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "boolean",
              "desc": "`true` if the password matches. "
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "encoded",
              "desc": "Encoded PHC hash string."
            },
            {
              "lua_type": "buffer",
              "name": "password",
              "desc": "Password to test."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 233
          },
          "is_method": false,
          "signature": "argon2.encoded_len(\n    time_cost: number,  -- Number of passes over memory.\n    memory_kib: number,  -- Memory cost in KiB.\n    parallelism: number,  -- Number of lanes/threads.\n    salt_len: number,  -- Salt length in bytes.\n    hash_len: number,  -- Raw hash length in bytes.\n    variant: \"argon2d\" | \"argon2i\" | \"argon2id\"  -- One of `\"argon2d\"`, `\"argon2i\"`, or `\"argon2id\"`.\n) → (\n    number  -- Maximum encoded string length including the trailing NUL used by the underlying C API. \n)",
          "owner": "argon2",
          "desc": "Returns the maximum encoded string length for the given parameters.\n\nThis can be useful when pre-allocating storage or validating size\nlimits before calling one of the `*_hash_encoded` functions.\n",
          "tags": [],
          "name": "encoded_len",
          "return_str": "number",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "number",
              "desc": "Maximum encoded string length including the trailing NUL used by the underlying C API. "
            }
          ],
          "params": [
            {
              "lua_type": "number",
              "name": "time_cost",
              "desc": "Number of passes over memory."
            },
            {
              "lua_type": "number",
              "name": "memory_kib",
              "desc": "Memory cost in KiB."
            },
            {
              "lua_type": "number",
              "name": "parallelism",
              "desc": "Number of lanes/threads."
            },
            {
              "lua_type": "number",
              "name": "salt_len",
              "desc": "Salt length in bytes."
            },
            {
              "lua_type": "number",
              "name": "hash_len",
              "desc": "Raw hash length in bytes."
            },
            {
              "lua_type": "\"argon2d\" | \"argon2i\" | \"argon2id\"",
              "name": "variant",
              "desc": "One of `\"argon2d\"`, `\"argon2i\"`, or `\"argon2id\"`."
            }
          ]
        }
      ],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "Argon2 password hashing.\n\nProvides the three Argon2 variants:\n\n- **Argon2d**: data-dependent memory access. Fast, but not suitable\n  for password hashing in side-channel-sensitive environments.\n- **Argon2i**: data-independent memory access. Safer against side\n  channels, but typically slower.\n- **Argon2id**: hybrid mode combining the best properties of Argon2i\n  and Argon2d. This is generally the preferred default for password\n  hashing.\n\nEach variant is available in two forms:\n\n- `*_hash_raw`: returns the raw derived bytes as a `buffer`\n- `*_hash_encoded`: returns the PHC string form such as\n  `\"$argon2id$v=19$m=65536,t=3,p=4$...\"`\n\nThe encoded form is the one you usually want to store in a database,\nsince it embeds the variant and cost parameters. Use\n[[verify_encoded]] to check a password against one of those strings.\n\n```luau\nlocal argon2 = require(\"@eryx/crypto/hazmat/argon2\")\nlocal random = require(\"@eryx/crypto/hazmat/random\")\n\nlocal password = buffer.fromstring(\"hunter2\")\nlocal salt = random.bytes(16)\n\nlocal encoded = argon2.argon2id_hash_encoded(password, salt, 3, 65536, 1, 32)\nassert(argon2.verify_encoded(encoded, password))\n```\n"
    }
  ]
}