0.0.40 • Published 5 months ago

@jrc03c/make-key v0.0.40

Weekly downloads
-
License
ISC
Repository
-
Last release
5 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:

import { makeKey } from "@jrc03c/make-key"
console.log(makeKey(32))
// "33189046179171bfb492577f0fdca4ca"

Browser:

<script src="path/to/@jrc03c/make-key/dist/make-key.min.js"></script>
<script>
  // (`makeKey` is available in the global scope)
  console.log(makeKey(32))
  // "8v1101x1whevcm1cgdhuq90e12549xri"
</script>

API

makeKey(length, charset, randomFn)

Returns a random string of length length. Can optionally accept:

  • charset = a string (or an array of strings) defining the characters from which to generate the new string; uses abcdef1234567890 by default
  • randomFn = a random number generation function; uses Math.random by default

CLI

Installation

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

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

sudo apt-get install -y xsel

Usage

key 32
# e1123ab8eff4082147cef3adc030769d

key 32 foobar
# aaoobrrforfbbfoofffooffroaoofaba

API

key <length> <charset>

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

0.0.40

5 months ago

0.0.37

7 months ago

0.0.38

5 months ago

0.0.39

5 months ago

0.0.33

8 months ago

0.0.34

8 months ago

0.0.35

8 months ago

0.0.36

8 months ago

0.0.32

1 year ago

0.0.30

1 year ago

0.0.31

1 year ago

0.0.29

1 year ago

0.0.20

1 year ago

0.0.21

1 year ago

0.0.23

1 year ago

0.0.24

1 year ago

0.0.25

1 year ago

0.0.17

1 year ago

0.0.18

1 year ago

0.0.19

1 year ago

0.0.26

1 year ago

0.0.27

1 year ago

0.0.28

1 year ago

0.0.16

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

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago