0.0.32 • Published 30 days ago

@jrc03c/make-key v0.0.32

Weekly downloads
-
License
ISC
Repository
-
Last release
30 days 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

30 days ago

0.0.30

1 month ago

0.0.31

1 month ago

0.0.29

1 month ago

0.0.20

3 months ago

0.0.21

3 months ago

0.0.23

2 months ago

0.0.24

2 months ago

0.0.25

2 months ago

0.0.17

3 months ago

0.0.18

3 months ago

0.0.19

3 months ago

0.0.26

2 months ago

0.0.27

2 months ago

0.0.28

2 months ago

0.0.16

4 months ago

0.0.15

7 months ago

0.0.14

1 year ago

0.0.10

2 years ago

0.0.11

1 year ago

0.0.12

1 year ago

0.0.13

1 year 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