Alpha-numeric Indexes creation.
npm install alpha-idAlphaID
========

Shell
http://myblog.com/posts/4815162342
`
If you use AlphaID you can convert to this:
`Shell
http://myblog.com/posts/iWroDM
`
Something like YouTube's links ;)
#### Install
To install globally use:
`Shell
npm install alpha-id -g
`
To install on a project use:
`Shell
cd my_project_folder
npm install alpha-id
`
#### Coding
On the same folder, create the file "index.js", and put this content:
`JavaScript
var AlphaID = require('alpha-id');
AlphaID.do(4815162342 ,false, function(e,s){
console.log(s);
AlphaID.do(s,true, function (e,n) {
console.log(n);
});
});
`
To test the code, execute on the terminal:
`Shell
node index.js
`
#### Explaining
Inside AlphaID we have 3 main methods,
* encode(number, callBack) - Convert a number into an alpha-numeric ID.
* decode(string, callBack) - Convert a alpha-numeric ID into a number.
do(value,toNum, callBack) -Both cases, with 'toNum*' boolean flag.
The default value to the flag 'toNum' is false.
When 'toNum' is false the function returns encode(n) and when 'toNum' is true the function returns decode(n).
###### CallBack
Since 0.0.4 AlphaID has CallBack support,
the function structure is simple.
`JavaScript
function callBack(error,return){};
`
* Error - Return if the process eventually fails, and the reason to.
* Return - The value that the function should return.
##### Changing Index
If you want to create your own index, use this code below to override...
Warnings:
* Always remember to put the same amount of characters on the original index.
* Also remember to don't use invalid URL chars, like #,%,@,& ... that will make AlphaID untrustable.
`JavaScript
var AlphaID = require('alpha-id');
AlphaID.options.index = 'abcdefghijklmnopqrstuvxzABCDEFGHIJKLMNOPQRSTUVXZ0123456789';
AlphaID.do(4815162342 ,false, function(e,r){
console.log(r);
});
``