UUID(optionstring) ;generate a UUID
;Options:
; -r, --random generate random-based uuid
; -t, --time generate time-based uuid
; -n, --namespace ns generate hash-based uuid in this namespace
; available namespaces: @dns @url @oid @x500
; -N, --name name generate hash-based uuid from this name
; -m, --md5 generate md5 hash
; -s, --sha1 generate sha1 hash
; -x, --hex interpret name as hex string
;the option string should have all the desired options together
; "-r -n @oid --name test --sha1"
N UUID,CALL,%CIO,FILE,commandstring
S %CIO=$I
S optionstring=$G(optionstring)
s commandstring="uuidgen "_optionstring
S CALL="uuidgen"
O CALL:(command=commandstring:noreadonly:stream:nofixed:nowrap)::"PIPE"
U CALL R UUID:2
U %CIO
C CALL
Q:$Q UUID Q