Skip to content

Instantly share code, notes, and snippets.

@mrjbq7

mrjbq7/gist:37133

Created Dec 17, 2008
Embed
What would you like to do?
USING: alien.syntax alien.c-types byte-arrays kernel strings ;
IN: uuid
LIBRARY: uuid
FUNCTION: void uuid_generate ( char[16] out ) ;
FUNCTION: void uuid_unparse ( char[16] out, char* out ) ;
: uuid ( -- string )
16 "char" <c-array> dup uuid_generate
36 <byte-array> [ uuid_unparse ] keep >string ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment