diff --git a/assets/generator.html b/assets/generator.html new file mode 100644 index 0000000..713d134 --- /dev/null +++ b/assets/generator.html @@ -0,0 +1,71 @@ +
Press the buttons below to generate your short uuid codes:
+ Length: + ++ Your random UUID: +
+ ++ Your sequential UUID: +
++ The ability to set a custom dictionary and length means that Short Unique ID is useful for many other cases such as this random color generator. +
+
+
+ // instantiate using a dictionary containing all 16 valid hex characters
+
+ var uid = new ShortUniqueId({
+ dictionary: [
+ '0', '1', '2', '3',
+ '4', '5', '6', '7',
+ '8', '9', 'A', 'B',
+ 'C', 'D', 'E', 'F',
+ ],
+ });
+
+ // or using default dictionaries available since v4.3+
+
+ var uid = new ShortUniqueId({ dictionary: 'hex' });
+
+ // then taste the rainbow 🌈
+
+ var color = '#' + uid.randomUUID(6) + ';';
+
+
+ + + Your random color: +
+ + +Press the buttons below to generate your short uuid codes:
+ Length: + ++ Your random UUID: +
+ ++ Your sequential UUID: +
++ The ability to set a custom dictionary and length means that Short Unique ID is useful for many other cases such as this random color generator. +
+
+
+ // instantiate using a dictionary containing all 16 valid hex characters
+
+ var uid = new ShortUniqueId({
+ dictionary: [
+ '0', '1', '2', '3',
+ '4', '5', '6', '7',
+ '8', '9', 'A', 'B',
+ 'C', 'D', 'E', 'F',
+ ],
+ });
+
+ // or using default dictionaries available since v4.3+
+
+ var uid = new ShortUniqueId({ dictionary: 'hex' });
+
+ // then taste the rainbow 🌈
+
+ var color = '#' + uid.randomUUID(6) + ';';
+
+
+ + + Your random color: +
+ + +const uid = new ShortUniqueId(); uid.fmt(format: string);
Optional
Returns Date
const uid = new ShortUniqueId(); uid.rnd(uuidLength: number);
const uid = new ShortUniqueId(); uid.seq();
Optional
Returns void
Optional
Returns string