Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @if (@X) == (@Y) @end /* JScript comment
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- ::Create Random GUIDs Via Batch ::
- ::Created by D.RUSS#2430 [http://russdev.mooo.com/] ::
- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
- @title Create Random GUIDs
- :GenerateNewGUID
- @echo off
- for /f "tokens=*" %%a in ('cscript //E:JScript //nologo "%~f0" "%~nx0"') do (
- if "%~1" equ "" (
- echo %%a
- ) else (
- set "%~1=%%a"
- )
- )
- %my_uuid%
- echo ==Press Enter For New GUID==
- pause >nul
- echo(
- goto :GenerateNewGUID
- @if (@X)==(@Y) @end JScript comment */
- UUIDv4 =
- function b(
- a // placeholder
- ){
- return a // if the placeholder was passed, return
- ? ( // a random number from 0 to 15
- a ^ // unless b is 8,
- Math.random() // in which case
- * 16 // a random number from
- >> a/4 // 8 to 11
- ).toString(16) // in hexadecimal
- : ( // or otherwise a concatenated string:
- [1e7] + // 10000000 +
- -1e3 + // -1000 +
- -4e3 + // -4000 +
- -8e3 + // -80000000 +
- -1e11 // -100000000000,
- ).replace( // replacing
- /[018]/g, // zeroes, ones, and eights with
- b // random hex digits
- )
- }
- WScript.Echo(UUIDv4());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement