Skip to content

Instantly share code, notes, and snippets.

@mrjbq7
Created December 17, 2008 17:07
Show Gist options
  • Save mrjbq7/37133 to your computer and use it in GitHub Desktop.
Save mrjbq7/37133 to your computer and use it in GitHub Desktop.
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