New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@types/xsalsa20

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/xsalsa20

TypeScript definitions for xsalsa20

ts4.5
ts4.6
ts4.7
ts4.8
ts4.9
ts5.0
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
ts6.0
latest
Source
npmnpm
Version
1.1.3
Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/xsalsa20

Summary

This package contains type definitions for xsalsa20 (https://github.com/mafintosh/xsalsa20).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/xsalsa20.

index.d.ts

/// <reference types="node" />

export = XSalsa20;

declare const XSalsa20: XSalsa20.XSalsa20;

declare namespace XSalsa20 {
    interface XSalsa20 {
        /**
         * Bytes required for the nonce buffer.
         */
        readonly NONCEBYTES: number;

        /**
         * Bytes required for the key buffer.
         */
        readonly KEYBYTES: number;

        /**
         * Create a new xor instance.
         *
         * @param nonce Should be 24 bytes.
         * @param key Should be 32 bytes.
         */
        (nonce: Uint8Array | Buffer, key: Uint8Array | Buffer): Xor;

        /**
         * Create a new xor instance.
         *
         * @param nonce Should be 24 bytes.
         * @param key Should be 32 bytes.
         */
        new(nonce: Uint8Array | Buffer, key: Uint8Array | Buffer): Xor;
    }

    interface Xor {
        /**
         * Update the xor instance with a new input buffer. Optionally you can pass in an output buffer.
         *
         * @example
         * import * as crypto from 'crypto';
         * import xsalsa20 = require('xsalsa20');
         *
         * const key = crypto.randomBytes(xsalsa20.KEYBYTES);
         * const nonce = crypto.randomBytes(xsalsa20.NONCEBYTES);
         *
         * const xor = xsalsa20(nonce, key);
         *
         * console.log(xor.update(Buffer.from('hello')));
         * console.log(xor.update(Buffer.from('world')));
         *
         * xor.finalize();
         */
        update<TOut extends Uint8Array | Buffer = Uint8Array>(input: Uint8Array | Buffer, output?: TOut): TOut;

        /**
         * Clears internal state. Call this method last.
         */
        finalize(): void;
    }
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: @types/node

Credits

These definitions were written by BendingBender.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts