The following Google Apps Script is designed to generate a quick, random and fairly unique value. I've found it useful for generating some random strings for meeting IDs. I have included a JavaScript 'slice' so that I can generate just an 8-character value for instance (you can adjust as required).
var uniqueValue = Utilities.getUuid();
var shortUniqueValue = uniqueValue.slice(0, 8);