@ncthbrt/re-secure-random-string

BuckleScript/ReasonML Bindings for secure-random-string

Stats

StarsIssuesVersionUpdatedCreatedSize
@ncthbrt/re-secure-random-string
102.0.03 years ago4 years agoMinified + gzip package size for @ncthbrt/re-secure-random-string in KB

Readme

re-secure-random-string

This is a simple wrapper around node's secure-random-string for BuckleScript and Reason. Safely generating a random string for cryptographic purposes is difficult using Node's build in crypto library. The secure-random-string library aims to make this easier.

Getting Started

Install using npm:

npm install --save @ncthbrt/re-secure-random-string

Then add @ncthbrt/re-secure-random-string as a dependency in bsconfig.json.

Usage

Synchronous usage

let randomString = SecureRandomString.gen(~length=64, ());

Asynchronous usage

SecureRandomString.gen(~length=64, ())
|> Js.Promise.then_(randomString => {
      Js.log2("Random string is", randomString);
      Js.Promise.resolve();
});

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.