'use strict';

var uuid = require('uuid');

var UUID_LENGTH = 36;

var generateId = function() {
    // use a v1 id. This includes the device hardware in the generation, so there is more chance of uniqueness
    return uuid.v1();
};

var isValid = function(id) {
    // start with an initial test of checking that the length is correct
    return id && id.length === UUID_LENGTH;
};

module.exports = {
    generateId: generateId,
    isValid: isValid
};