csprsg
v1.0.5
Published
Creates cryptographically secure pseudo random strings
Downloads
10
Maintainers
Readme
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
}
})();