I’m a bit confused about the kind of UUIDs supposed to be used in KiCad v6 schematics files, but more generally in the S-Expression format.
According to the spec,
The UUID attribute is a SHA256 hash that is unique for every object in a KiCad file format.
But looking at a few schematic files, UUIDs generated by KiCad seem to be type 4 - for instance: “8efee08b-b92e-4ba6-8722-c058e18114fe” - which are not SHA-based, but fully random.
Could you tell us more about that, and if that actually matters? (Reason I ask is I’m thinking of writing a tool to generate KiCad schematics.)
If you just want to generate the schematic, you can omit those and KiCad will generate them for you when you open the file. Probably this is a hack, but worked for me. See Programmatically generating schematic
We use the pseudo-random number generator mt19937 (as defined in “Mersenne Twister: A 623-dimensionally equidistributed uniform pseudo-random number generator”, Makoto Matsumoto and Takuji Nishimura, ACM Transactions on Modeling and Computer Simulation: Special Issue on Uniform Random Number Generation, Vol. 8, No. 1, January 1998, pp. 3-30) to generate our UUIDs.
They should be globally unique, not just unique within a document. But we don’t currently rely on that.