Generate random UUID
Pyth, 20 bytes
j\-msm.HO16*4hdj83 3
Demonstration.
Encodes [1, 0, 0, 0, 2]
as 83 in base 3, then adds one and multiplies by four to get the length of each segment. Then makes hex digits and joins on hyphens.
CJam, 26 25 bytes
8 4__C]{{Gmr"%x"e%}*'-}/;
Try it online in the CJam interpreter.
How it works
8 4__C]{ }/ For each I in [8 4 4 4 12]:
{ }* Do I times:
Gmr Pseudo-randomly select an integer between 0 and 15.
"%x"e% Apply hexadecimal string formatting.
'- Push a hyphen-minus.
; Discard the last hyphen-minus.
Julia, 80 bytes
h=hex(rand(Uint128),32)
print(h[1:8]"-"h[9:12]"-"h[13:16]"-"h[17:20]"-"h[21:32])
Generate a random 128-bit integer, get its hexidecimal representation as a string padded to 32 digits, and divide that into segments joined with dashes.
Thanks to ConfusedMr_C and kvill for their help!