# @types/keccak

> TypeScript definitions for keccak

Latest version **3.0.5** (published 2024-10-07) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 55/100 (C)** — status: stable.

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

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 3.0.5 |
| Published | 2024-10-07 |
| First published | 2020-04-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

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

## Dependencies (1)

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

## Recent versions

- 3.0.5 (latest) — 2024-10-07
- 3.0.4 (ts4.7) — 2023-11-07
- 3.0.1 (ts3.3) — 2020-05-04
- 3.0.0 (ts2.8) — 2020-04-27
- 3.0.3 — 2023-10-18
- 3.0.2 — 2023-09-14

## README

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

import { Transform, TransformOptions } from "stream";

declare namespace createHash {
    class Keccak extends Transform {
        constructor(
            rate: number,
            capacity: number,
            delimitedSuffix: number | null,
            hashBitLength: number,
            options: TransformOptions,
        );
        update(data: string | Buffer, encoding?: BufferEncoding): Keccak;
        digest(): Buffer;
        digest(encoding: BufferEncoding): string;
    }

    class Shake extends Transform {
        constructor(rate: number, capacity: number, delimitedSuffix: number | null, options: TransformOptions);
        update(data: string | Buffer, encoding?: BufferEncoding): Shake;
        squeeze(dataByteLength: number): Buffer;
        squeeze(dataByteLength: number, encoding: BufferEncoding): string;
    }

    type KeccakAlgorithm = "keccak224" | "keccak256" | "keccak384" | "keccak512";
    type Sha3Algorithm = "sha3-224" | "sha3-256" | "sha3-384" | "sha3-512";
    type ShakeAlgorithm = "shake128" | "shake256";
}

declare function createHash(
    algorithm: createHash.KeccakAlgorithm | createHash.Sha3Algorithm,
    options?: TransformOptions,
): createHash.Keccak;

declare function createHash(
    algorithm: createHash.ShakeAlgorithm,
    options?: TransformOptions,
): createHash.Shake;

export = createHash;

````

### Additional Details
 * Last updated: Mon, 07 Oct 2024 22:07:58 GMT
 * Dependencies: [@types/node](https://npmjs.com/package/@types/node)

# Credits
These definitions were written by [odan](https://github.com/odanado).

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