diff --git a/Boop/Boop/scripts/GenerateUUID.js b/Boop/Boop/scripts/GenerateUUID.js new file mode 100644 index 00000000..d478bdd7 --- /dev/null +++ b/Boop/Boop/scripts/GenerateUUID.js @@ -0,0 +1,18 @@ +/** +{ +"api":1, +"name":"Generate UUID", +"description":"Generate UUID as v4", +"author":"ImanX", +"icon":"quote", +"tags":"uuid,generate" +} + **/ + +function main(input) { + input.text = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { + var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8); + return v.toString(16); + }); + +} \ No newline at end of file