flocon
v0.0.3
Published
64-bits Unique ID generator for Node.js written in C++
Downloads
4
Readme
flocon
64-bits unique ID generator for Node.js written in C++.
Due to Javascript limitations to handle 53 bits Integer, this module returns a 64 bits integer using a String representation.
flocon is meant to be used with mongoose and mongoose-long but feel free to use it with any other database.
Disclaimer
This is an experimental module. We strongly discourage you to use it production for the moment since we don't have tested it enough.
Despite, if you want to use and contribute to this module, your help is welcome!
Requirements
This module requires OS X 10.7 (or later) and Xcode 4.5 (or later) to be built.
Installation
npm install flocon --save
Usage
var flocon = require('flocon');
var id = flocon.snow();
flocon.snow()
Returns a Snowflake-inspired 64-bit IDs String object constructed using:
Tests
npm test
or check inside bench for more tests.
References
Licence
The MIT License (MIT)
Copyright (c) 2013 Yosee <[email protected]>
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/or sell copies of the Software, 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 or substantial portions 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.