Node.js-based GitHub-like Identicon implementation using Keccak32.
$ npm install legicon
Unless previously installed you'll need Cairo.
var Legicon = ;var UserLegicon = ;console;
Legicon exposes some API-functions from the underlying Canvas module.
To create a
PNGStream simply call
Legicon.pngStream(), and the stream will start to emit data events, finally emitting end when finished. If an exception occurs the error event is emitted. See
examples/TCP/pngStream.js for an example.
var fs =out = fsstream = Legicon;stream;stream;
Currently only sync streaming is supported, however we plan on supporting async streaming as well (of course :) ). Until then the
Legicon#toBuffer(callback) alternative is async utilizing
You can likewise create a
JPEGStream by calling
some optional parameters; functionality is otherwise identical to
examples/TCP/jpegStream.js for an example.
Note: At the moment,
jpegStream() is the same as
var stream = Legicon;
A call to
Legicon#toBuffer() will return a node
Buffer instance containing all of the PNG data. See
examples/TCP/buffer.js for an example.
Optionally we may pass a callback function to
Legicon#toBuffer(), and this process will be performed asynchronously, and will
Copyright (c) 2013 by Legify UG. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies, substantial portions or derivates of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.