cryptostache

1.0.2 • Public • Published

cryptostache

A short 2-sided encryption script that can turn your strings/ product keys into mustache-shaped bar codes!

Installation

  1. You need to make sure that Cairo is installed on your system. The platform-specific guides can be found here: https://github.com/Automattic/node-canvas/wiki/_pages

  2. Install the cryptostache package

    $ npm install cryptostache --save

Usage

var cryptostache = require('cryptostache');

var product_code = new cryptostache('some_product_code', 'secret_key');

console.log(product_code.value);
//The encoded product code (Hex string)

console.log(product_code.barcode());
//The base64 image data for your shiny new barcode :D

Customization

  1. You can specify the mask to use to create other shapes of barcode !

    product_code.template = (your base64 mask data);

  2. You can specify the color for the bars. (background is transparent)

    product_code.barcode('red');

TODO

  1. Finish masking

  2. Add better tests

  3. Document ideal template sizes

  4. Docs

  5. Optimize drawing (should be under 16ms)

Why?

Why not?

Package Sidebar

Install

npm i cryptostache

Weekly Downloads

0

Version

1.0.2

License

GPL-2.0

Last publish

Collaborators

  • fed135