https://github.com/fed135/cryptostache
[WIP] A Node script that can turn hashes into mustache-shaped barcodes!
https://github.com/fed135/cryptostache
Last synced: 3 months ago
JSON representation
[WIP] A Node script that can turn hashes into mustache-shaped barcodes!
- Host: GitHub
- URL: https://github.com/fed135/cryptostache
- Owner: fed135
- Created: 2014-05-05T15:27:58.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2016-02-16T21:25:59.000Z (almost 10 years ago)
- Last Synced: 2025-06-06T08:39:05.885Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cryptostache
A script that can turn your hashes 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
1. Add better tests
2. Document ideal template sizes
3. Docs
4. Optimize drawing (should be under 16ms)
## Why?
Why not?