Shortcode variable

I would like to call a go function rand.Intn(100) in a short code and use the variable returned in my html code.
How can I do this, Scratch ?

I don’t think the rand.Intn is available in the templates – but scratch would be the only way, but you might get bitten by the rendering order (or lack of order)…

It does not seem to work.

How can I generate a unique ID in a shortcode ? UUID or something like that