Example code for computing request IDs?

This is a bit dry: The Internet Computer Interface Specification | Internet Computer Home :stuck_out_tongue:

Can someone point to example code for computing request IDs please?

Here’s one from agent-js.

(For some reason the forum doesn’t let met copy & paste the code directly)