cryptostache
A short 2-sided encryption script that can turn your strings/ product keys into mustache-shaped bar codes!
Installation
-
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
-
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
-
You can specify the mask to use to create other shapes of barcode !
product_code.template = (your base64 mask data);
-
You can specify the color for the bars. (background is transparent)
product_code.barcode('red');
TODO
-
Finish masking
-
Add better tests
-
Document ideal template sizes
-
Docs
-
Optimize drawing (should be under 16ms)
Why?
Why not?