Skip to content

Instantly share code, notes, and snippets.

@oneeyedman
Last active June 6, 2023 20:03
Show Gist options
  • Save oneeyedman/84c805d7f6cb51a3aa13745eb4fd6559 to your computer and use it in GitHub Desktop.
Save oneeyedman/84c805d7f6cb51a3aa13745eb4fd6559 to your computer and use it in GitHub Desktop.
function getEthicID(divider = '/', prefix = '') {
const timestamp = new Date().toISOString().replace(/[^0-9]/g, '');
const randomChars = Math.random().toString(36).substring(2, 8).replace(' ', '_').toUpperCase();
return prefix + timestamp + divider + randomChars;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment