Generate secure and unique short IDs in JavaScript, tested for reliability and compatibility with browsers