0.0.32 • Published 9 months ago

@jrc03c/make-key v0.0.32

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

Intro

make-key generates alphanumeric strings of arbitrary length.

Node / browser

Installation

npm install --save https://github.com/jrc03c/make-key

Usage

Node / bundlers:

const makeKey = require("@jrc03c/make-key")
const keyLength = 32
const keySeed = 1234

console.log(makeKey(keyLength))
// "8v1101x1whevcm1cgdhuq90e12549xri"

console.log(makeKey(keyLength, keySeed))
// "dcb09fuuv3smirvqaetiyggvhap90e88"

Browser:

<script src="path/to/@jrc03c/make-key/dist/make-key.js"></script>
<script>
  // (makeKey is now in the global scope)

  const keyLength = 32
  const keySeed = 1234

  console.log(makeKey(keyLength))
  // "8v1101x1whevcm1cgdhuq90e12549xri"

  console.log(makeKey(keyLength, keySeed))
  // "dcb09fuuv3smirvqaetiyggvhap90e88"
</script>

API

makeKey(length, seed, charset)

Returns a random string of length length. Can optionally be given a random seed value as a number and/or a charset as a string of characters from which to generate the new string.

CLI

Installation

git clone https://github.com/jrc03c/make-key
cd make-key
npm link

Optionally, you can install xsel to automatically have the key copied to the clipboard:

sudo apt-get install -y xsel

Usage

# key <length> <seed>
key 32 12345

API

key <length> <seed> <charset>

These arguments mean the same thing as in the Node / browser API.

0.0.32

9 months ago

0.0.30

9 months ago

0.0.31

9 months ago

0.0.29

9 months ago

0.0.20

10 months ago

0.0.21

10 months ago

0.0.23

10 months ago

0.0.24

10 months ago

0.0.25

10 months ago

0.0.17

10 months ago

0.0.18

10 months ago

0.0.19

10 months ago

0.0.26

10 months ago

0.0.27

10 months ago

0.0.28

10 months ago

0.0.16

12 months ago

0.0.15

1 year ago

0.0.14

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago