nativescript-randombytes
NativeScript polyfill for Node randombytes
npm i --save nativescript-randombytes
  • Version: 1.0.0
  • GitHub:
  • Downloads:
    • Last Day:   0
    • Last Week:  0
    • Last Month: 0

NativeScript randombytes shim

The randombytes package doesn't work in the {N} runtime, so replace it by this package if you need to.

Installation

tns plugin add nativescript-randombytes

Usage

var randomBytes = require('nativescript-randombytes');

// sync usage
console.log("randomBytes: " + randomBytes(16));

// async usage
randomBytes(16, function (ignore, result) {
console.log("randomBytes async: " + result);
})