Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
randomstring
Advanced tools
Readme
Library to help you create random strings.
To install randomstring, use npm:
npm install randomstring
var randomstring = require("randomstring");
randomstring.generate();
// >> "XwPp9xazJ0ku5CZnlmgAx2Dld8SHkAeT"
randomstring.generate(7);
// >> "xqm5wXX"
randomstring.generate({
length: 12,
charset: 'alphabetic'
});
// >> "AqoTIzKurxJi"
randomstring.generate({
charset: 'abc'
});
// >> "accbaabbbbcccbccccaacacbbcbbcbbc"
randomstring.generate({
charset: ['numeric', '!']
});
// >> "145132!87663611567!2486211!07856"
randomstring.generate({
charset: 'abc'
}, cb);
// >> "cb(generatedString) {}"
randomstring.
generate(options, cb)
options
length
- the length of the random string. (default: 32) [OPTIONAL]readable
- exclude poorly readable chars: 0OIl. (default: false) [OPTIONAL]charset
- define the character set for the string. (default: 'alphanumeric') [OPTIONAL]
alphanumeric
- [0-9 a-z A-Z]alphabetic
- [a-z A-Z]numeric
- [0-9]hex
- [0-9 a-f]binary
- [01]octal
- [0-7]custom
- any given characters[]
- An array of any abovecapitalization
- define whether the output should be lowercase / uppercase only. (default: null) [OPTIONAL]
lowercase
uppercase
cb
- Optional. If provided uses async version of crypto.randombytes
$ npm install -g randomstring
$ randomstring
> sKCx49VgtHZ59bJOTLcU0Gr06ogUnDJi
$ randomstring 7
> CpMg433
$ randomstring length=24 charset=github readable
> hthbtgiguihgbuttuutubugg
npm install
npm test
node-randomstring is licensed under the MIT license.
FAQs
A module for generating random strings
The npm package randomstring receives a total of 457,137 weekly downloads. As such, randomstring popularity was classified as popular.
We found that randomstring demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.