Attaches to the String
type a random
function which returns a random string for the provided number of bytes and encoding with ascii
, base64
, hex
, latin1
and ucs2
as possible values. By default the number of bytes is 16
and the default encoding is hex
.
npm install @dizmo/functions-random --save
const { random } = require('@dizmo/functions-random');
random(16);
2fa6651ce3680dd13899156f9550ec61
random(16, 'hex');
d00e24ae8348004bca2f9c07ba6ae43b
random(16, 'ascii');
lZq\x01\x07j\x17:OnlG9u[\x13
random(16, 'base64');
QbqxfgF3JBiCktUQl+p9lQ==
random(16, 'latin1');
ؼ\x8D\x9F*>\nØ\x83BÃÑë{\x15Ð
random(16, 'ucs2');
☔戠䰍⧗灺밄䯗晡
npm run clean
npm run build
npm run -- build --no-lint --no-clean
npm run -- build --prepack
npm run -- build --prepack --no-minify
npm run lint
npm run -- lint --fix
npm run test
npm run -- test --no-lint --no-clean --no-build
npm run cover
npm run -- cover --no-lint --no-clean --no-build
npm run docs
npm publish
npm publish --access=public
© 2020 dizmo AG, Switzerland