Skip to content
Snippets Groups Projects

Unique Id generator

The snippet can be accessed without any authentication.
Authored by Julian Hellner

Generates a 9 character long unique Id.

Math.random should be unique because of its seeding algorithm. Convert it to base 36 (numbers + letters), and grab the first 9 characters after the decimal.

Edited
uid.js 69 B
function uid() {
	return Math.random().toString(36).substr(2, 9);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment