-
+
+
Refresh
- Copy token
+ Copy uuid{{ quantity > 1 ? 's' : ''}}
@@ -19,10 +20,13 @@
const noop = () => {
};
+ const generateUuid = () => ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16));
+
export default {
name: "UuidGenerator",
data: () => ({
- refreshBool: true
+ refreshBool: true,
+ quantity: 1
}),
methods: {
copyToken() {
@@ -34,14 +38,26 @@
token() {
if (this.refreshBool) noop(); // To force recomputation
- return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16));
+ return Array.from({length: this.quantity}, generateUuid).join('\n');
}
}
}
-
\ No newline at end of file