summaryrefslogtreecommitdiffstats
path: root/lib/utils/genKey.js
diff options
context:
space:
mode:
authorSamy Pesse <samypesse@gmail.com>2016-04-24 18:52:37 +0200
committerSamy Pesse <samypesse@gmail.com>2016-04-24 18:52:37 +0200
commit19a1db8cb43431352d30dbc48aebb9cc8bf58eec (patch)
tree582b10a38610420b44fe91c3647c7fc448655d5c /lib/utils/genKey.js
parentc3275a4aa985710c0fcc9d3f7104bc5ebed2eb04 (diff)
downloadgitbook-19a1db8cb43431352d30dbc48aebb9cc8bf58eec.zip
gitbook-19a1db8cb43431352d30dbc48aebb9cc8bf58eec.tar.gz
gitbook-19a1db8cb43431352d30dbc48aebb9cc8bf58eec.tar.bz2
Add base structure for templating
Diffstat (limited to 'lib/utils/genKey.js')
-rw-r--r--lib/utils/genKey.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/utils/genKey.js b/lib/utils/genKey.js
new file mode 100644
index 0000000..0650011
--- /dev/null
+++ b/lib/utils/genKey.js
@@ -0,0 +1,13 @@
+var lastKey = 0;
+
+/*
+ Generate a random key
+ @return {String}
+*/
+function generateKey() {
+ lastKey += 1;
+ var str = lastKey.toString(16);
+ return '00000'.slice(str.length) + str;
+}
+
+module.exports = generateKey;