Describes youtube’s method for “unique ID’s”
I would predict most people use something similar for GUID generation
There are also a number of technical documents on UUID generation, a quick google returns
Which covers generation.
I doubt you’d get an answer on what Twitch does specifically but there are technical guidelines on this sort of thing