# @types/srp

> TypeScript definitions for srp

Latest version **0.0.33** (published 2025-10-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/srp
pnpm add @types/srp
yarn add @types/srp
bun add @types/srp
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.33 |
| Published | 2025-10-24 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51442 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/srp
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/srp
- npm.io page: https://npm.io/package/@types/srp

## Dependencies (2)

- [@types/node](https://npm.io/package/@types/node.md) *
- [@types/bignum](https://npm.io/package/@types/bignum.md) *

## Recent versions

- 0.0.33 (latest) — 2025-10-24
- 0.0.32 (ts5.1) — 2023-11-07
- 0.0.29 (ts4.2) — 2022-12-05
- 0.0.28 (ts3.5) — 2020-05-15
- 0.0.27 (ts2.5) — 2016-09-19
- 0.0.31 — 2023-10-18
- 0.0.30 — 2023-09-25
- 0.0.26 — 2016-07-14
- 0.0.25-alpha — 2016-07-08
- 0.0.24-alpha — 2016-07-04
- 0.0.23-alpha — 2016-07-02
- 0.0.22-alpha — 2016-07-02
- 0.0.21-alpha — 2016-07-01
- 0.0.20-alpha — 2016-05-25
- 0.0.19-alpha — 2016-05-20
- … 2 more at https://npm.io/package/@types/srp/versions

## README

# Installation
> `npm install --save @types/srp`

# Summary
This package contains type definitions for srp (https://github.com/mozilla/node-srp).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/srp.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/srp/index.d.ts)
````ts
/// <reference types="bignum" />
/// <reference types="node" />

import BigNum = require("bignum");

export = SRP;

declare namespace SRP {
    export interface Params {
        N_length_bits: number;
        N: BigNum;
        g: BigNum;
        hash: string;
    }

    export var params: {
        [bits: string]: Params;
    };

    /**
     * The verifier is calculated as described in Section 3 of [SRP-RFC].
     * We give the algorithm here for convenience.
     *
     * The verifier (v) is computed based on the salt (s), user name (I),
     * password (P), and group parameters (N, g).
     *
     *         x = H(s | H(I | ":" | P))
     *         v = g^x % N
     *
     * @param {Params} params group parameters, with .N, .g, .hash
     * @param {Buffer} salt salt
     * @param {Buffer} I user identity
     * @param {Buffer} P user password
     *
     * @returns {Buffer}
     */
    export function computeVerifier(params: Params, salt: Buffer, I: Buffer, P: Buffer): Buffer;

    /**
     * Generate a random key.
     *
     * @param {number} bytes length of key (default=32)
     * @param {function} callback function to call with err,key
     */
    export function genKey(bytes: number, callback: (error: Error, key: Buffer) => void): void;

    /**
     * Generate a random 32-byte key.
     *
     * @param {function} callback function to call with err,key
     */
    export function genKey(callback: (error: Error, key: Buffer) => void): void;

    export class Client {
        constructor(params: Params, salt: Buffer, identity: Buffer, password: Buffer, secret1: Buffer);
        computeA(): Buffer;
        setB(B: Buffer): void;
        computeM1(): Buffer;
        checkM2(M2: Buffer): void;
        computeK(): Buffer;
    }

    export class Server {
        constructor(params: Params, verifier: Buffer, secret2: Buffer);
        computeB(): Buffer;
        setA(A: Buffer): void;
        checkM1(M1: Buffer): Buffer;
        computeK(): Buffer;
    }
}

````

### Additional Details
 * Last updated: Fri, 24 Oct 2025 04:02:41 GMT
 * Dependencies: [@types/bignum](https://npmjs.com/package/@types/bignum), [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by .

---
_Source: https://npm.io/package/@types/srp · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
