@program guid.muf 1 10000 d i $libdef guid : zeropad[ str:hex int:digits -- str:result ] "0000000000000000" hex @ strcat dup strlen digits @ - strcut swap pop ; : guid[ -- str:guid ] { systime_precise modf swap int itoh "-" rot 65536.0 * int itoh 4 zeropad "-" random 65536 % itoh 4 zeropad "-" random 65536.0 / int itoh 4 zeropad "-" frand 2.0 16.0 pow * int itoh 4 zeropad frand 2.0 16.0 pow * int itoh 4 zeropad frand 2.0 16.0 pow * int itoh 4 zeropad }join ; PUBLIC guid : main { guid }tell ; . c q