1.0.0-beta-01 • Published 10 years ago

key-forge v1.0.0-beta-01

Weekly downloads
6
License
MIT
Repository
github
Last release
10 years ago

Key Forge

A simple key generation library for use with Node. More or less a convenience wrapper around Node's Crypto and Buffer libraries.

Install

npm install key-forge

Usage

Although Key Forge has a number of functions that you can use to fine-tune your key generation, mostly what you want is this:

{randomKey} = require "key-forge"
keySize = 16 # bytes
key = randomKey keySize # defaults to hex encoding
key = randomKey keySize, "hex"
key = randomKey keySize, "base64"
key = randomKey keySize, "base64url"

Notes on Encodings

  • "hex": direct output from Node.js Buffer.toString("hex")

  • "base64": output from Buffer.toString("base64") with the "=" padding stripped.

  • "base64url": Based on http://tools.ietf.org/html/rfc4648#section-5, with padding stripped.

1.0.0-beta-01

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.5

10 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago