'use strict'; angular.module('aqe').service('Aqecore', function() { this.createUniqueSessionId = function() { var pad = function (num, size) { var s = num+""; while (s.length < size) s = "0" + s; return s; }; // https://momentjs.com/docs/#/displaying/format/ // No O return moment().format('DDss') + pad(Math.ceil(Math.random()*100), 2) + Math.random().toString(24).substring(2,4).toUpperCase(); }; this.get = function() { return list; } this.getSize = function(obj) { var size = 0, key; for (key in obj) { if (obj.hasOwnProperty(key)) size++; } return size; }; });