mirror of
https://github.com/badges/shields.git
synced 2026-11-21 16:06:35 +03:00
Signed-off-by: Gautam Kumar <gautamkumarofficial@users.noreply.github.com> Co-authored-by: Gautam Kumar <gautamkumarofficial@users.noreply.github.com>
12 lines
311 B
JavaScript
12 lines
311 B
JavaScript
/**
|
|
* Generate a random 9-character alphanumeric instance identifier.
|
|
*
|
|
* @returns {string} Random identifier (e.g. `a1b2c3d4e`).
|
|
*/
|
|
function generateInstanceId() {
|
|
// from https://gist.github.com/gordonbrander/2230317
|
|
return Math.random().toString(36).substr(2, 9)
|
|
}
|
|
|
|
export default generateInstanceId
|