Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

crispy-string

Package Overview
Dependencies
Maintainers
6
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

crispy-string

Tool to create random string with a specific baseN charset.

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
160
increased by33.33%
Maintainers
6
Weekly downloads
 
Created
Source

Crispy String

Build Status

A simple tool that creates random base 10, 16, 32, 62 and 64 strings. Very useful to give random ids to objects or to give a unique filename to any uploaded file when you just want it to be unique and sanitized.

Installing.

 npm install crispy-string

Basic example.

Creating a string with just decimals and a length of 8 characters is as simple as:

  var crispy = require('crispy-string');

  crispy.base10String(8);

Methods.

base10String(length)

Creates a random decimal string

Character pool: Digits

  crispy.base10String(8); // => '98145208'
base16String(length)

Creates a random hexadecimal string

Character pool: Digits, Uppercase A to F

  crispy.base16String(8); // => 'A81FB209'
base32String(length)

Creates a random base 32 string:

Character pool: Digits, Uppercase A to Z

  crispy.base32String(8); // => 'a81Fb2cz'
base62String(length)

Creates a random base 62 string

Character pool: Digits, Uppercase A to Z and Lowercase a to z

  crispy.base62String(8); // => 'ab82dE0X'
base64String(length)

Creates a random base 64 string

Character pool: Digits, Uppercase A to Z, Lowercase a to z, + and /

  crispy.base64String(8); // => 'x8/dFB0+'

Keywords

FAQs

Package last updated on 19 Feb 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc