Search code examples
cembeddeduuidguid

How to generate a UUID in embedded C


I want to generate guids to name a set of different files. The main restriction I am having is the fact that I need to implement this in an embedded microcontroller with an RTOS.

The main UUID/GUID libraries i've found are linux/windows based, but don't work for my case. Is there a simple, lightweight implementation available I could use? or I would need to generate my own GUID generator?

Edit: The MCU does have a random number generator and a real time clock.


Solution

  • I solved the issue using GUID. Initially I thought I could use this only on linux based systems but turns out it can also be used for the MCU and the implementation is quite light weight.

    The procedure to generate the GUID comes from this website which also provides the sourcecode of the UUID.c library.

    Solution provided by @Kamil Cuk .