Mint the stable identity of one checkout operation.
Why this is not crypto.randomUUID()
Crypto.randomUUID() is exposed only in a secure context. This application is
served over plain HTTP by the local Compose gateway, and the ordering tablet is
reached over the truck's own network, where the origin is not a secure context
and crypto.randomUUID is undefined. Calling it directly would therefore throw
and break the payment control on the very device this feature exists for.
Crypto.getRandomValues() is documented as the one Crypto member usable from an
insecure context, so the identifier is assembled from it here instead. See
docs/techstack.md §5 for the plain-HTTP gateway and the explicitly deferred
Caddy/HTTPS work.
The value is still an RFC 4122 version 4 UUID, which is what the backend contract
requires. It carries no secret and no authority: it is a client-minted identity that
persistence admits, so its only obligation is to be unique, not unpredictable.
Mint the stable identity of one checkout operation.
Why this is not
crypto.randomUUID()Crypto.randomUUID()is exposed only in a secure context. This application is served over plain HTTP by the local Compose gateway, and the ordering tablet is reached over the truck's own network, where the origin is not a secure context andcrypto.randomUUIDisundefined. Calling it directly would therefore throw and break the payment control on the very device this feature exists for.Crypto.getRandomValues()is documented as the oneCryptomember usable from an insecure context, so the identifier is assembled from it here instead. Seedocs/techstack.md§5 for the plain-HTTP gateway and the explicitly deferred Caddy/HTTPS work.The value is still an RFC 4122 version 4 UUID, which is what the backend contract requires. It carries no secret and no authority: it is a client-minted identity that persistence admits, so its only obligation is to be unique, not unpredictable.