csprsg
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

CSPRSG

Cryptographically Secure Pseudo Random String Generator

Built in TypeScript for node

Installing

npm install csprsg

Usage

import {
    generateSecureRandomString,
    InvalidLengthError,
    UnableToGenerateRandomness
} from 'csprsg';

(async () => {
    let s: string;
    
    try {
        s = await generateSecureRandomString(100);
    } catch (error) {
        // Handle either InvalidLengthError or UnableToGenerateRandomness
    }
})();

Package Sidebar

Install

npm i csprsg

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

9.56 kB

Total Files

15

Last publish

Collaborators

  • ryanstaniforth