{
  "classes": [
    {
      "constants": [],
      "types": [],
      "name": "@eryx/crypto/password",
      "tags": [],
      "functions": [
        {
          "source": {
            "path": "",
            "line": 50
          },
          "is_method": false,
          "signature": "password.hash(\n    password: string  -- The plaintext password to hash.\n) → (\n    string  -- Tagged password hash suitable for database storage. \n)",
          "owner": "password",
          "desc": "Hashes a plaintext password for storage.\n\nThe result is a tagged string beginning with `\"$a$\"` followed by an\nArgon2id PHC string. The PHC portion embeds the salt and work-factor\nparameters, so you only need to store the returned string.\n\n```luau\nlocal stored = password.hash(\"correct horse battery staple\")\n```\n",
          "tags": [],
          "name": "hash",
          "return_str": "string",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "string",
              "desc": "Tagged password hash suitable for database storage. "
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "password",
              "desc": "The plaintext password to hash."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 80
          },
          "is_method": false,
          "signature": "password.verify(\n    password: string,  -- The plaintext password to test.\n    hash: string  -- The stored tagged hash string returned by [[hash]].\n) → (\n    boolean  -- `true` if the password matches. \n)",
          "owner": "password",
          "desc": "Verifies a plaintext password against a stored hash.\n\nThe hash must be in this module's tagged format. Returns `true` if the\npassword matches, otherwise `false`. Raises an error if the hash uses\nan unsupported tag or is malformed.\n\n```luau\nif password.verify(inputPassword, storedHash) then\n\tprint(\"password accepted\")\nend\n```\n",
          "tags": [],
          "name": "verify",
          "return_str": "boolean",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "boolean",
              "desc": "`true` if the password matches. "
            }
          ],
          "params": [
            {
              "lua_type": "string",
              "name": "password",
              "desc": "The plaintext password to test."
            },
            {
              "lua_type": "string",
              "name": "hash",
              "desc": "The stored tagged hash string returned by [[hash]]."
            }
          ]
        }
      ],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "High-level password hashing and verification.\n\nThis module is the user-facing API for password storage. It hashes\npasswords with Argon2id using sensible defaults and stores them in a\ntagged string format so the scheme can evolve later without guessing.\n\nThe current format is:\n\n- `\"$a$<argon2-phc-string>\"`\n\nwhere the inner value is the standard Argon2 PHC encoded form\ncontaining the salt and cost parameters.\n\n```luau\nlocal password = require(\"@eryx/crypto/password\")\n\nlocal stored = password.hash(\"hunter2\")\nassert(password.verify(\"hunter2\", stored))\nassert(not password.verify(\"wrong-password\", stored))\n```\n"
    }
  ]
}