Skip to content

ryanstaniforth/csprsg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
    }
})();

About

Creates cryptographically secure pseudo-random strings

Resources

License

Stars

Watchers

Forks

Packages

No packages published