var shortlink = require("../lib/shortlink");

setInterval(function() {

    // Generate random
    var random = shortlink.generate(1);

    // Decode random string
    var id = shortlink.decode(random);

    // Encode to string
    var str = shortlink.encode(id);

    // Decode string
    var res = shortlink.decode(str);

    console.log('id = ' + id);
    console.log(random + ' : ' + str);
    console.log('id = ' + res);
    console.log('----------------');

}, 2000);



@@ -128,9 +128,66 @@
 ate(
-1
+6);%0A    console.log('Generate random shortlink: ' + random
 );%0A%0A
@@ -208,21 +208,31 @@
 random s
-tring
+hortlink to int
 %0A    var
@@ -267,64 +267,59 @@
 m);%0A
-%0A
     
-// Encode to string%0A    var str = shortlink.encode(
+console.log('Decode this shortlink to int: ' + 
 id);
@@ -331,21 +331,36 @@
  // 
-De
+En
 code 
-string
+this int to shortlink
 %0A   
@@ -364,19 +364,19 @@
     var 
-res
+str
  = short
@@ -384,22 +384,20 @@
 ink.
-d
 e
+n
 code(
-str
+id
 );%0A
-%0A
     
@@ -413,82 +413,168 @@
 og('
-id =
+Encode this int to shortlink:
  ' + 
-id
+str
 );%0A
+%0A
     
-console.log(random + ' : ' + str);%0A    console.log('id =
+// Decode this shortlink to int%0A    var res = shortlink.decode(str);%0A    console.log('Decode this shortlink to int:
  ' +
@@ -580,16 +580,17 @@
 + res);%0A
+%0A
     cons
@@ -612,18 +612,16 @@
 --------
---
 ');%0A%0A%7D, 

Change demo