Buckets:
silverwolf-x/project / test /e2e /app-dir /cache-components /app /node-crypto /random-int /between /cached /page.tsx
| import crypto from 'node:crypto' | |
| import { SentinelValue } from '../../../../getSentinelValue' | |
| export default async function Page() { | |
| const first = await getRandomIntBetween(1) | |
| const second = await getRandomIntBetween(2) | |
| return ( | |
| <div> | |
| <dl> | |
| <dt>[first] require('node:crypto').randomInt(min, max)</dt> | |
| <dd id="first">{first}</dd> | |
| <dt>[second] require('node:crypto').randomInt(min, max)</dt> | |
| <dd id="second">{second}</dd> | |
| </dl> | |
| <span id="page"> | |
| <SentinelValue /> | |
| </span> | |
| </div> | |
| ) | |
| } | |
| async function getRandomIntBetween(nonce: number) { | |
| 'use cache' | |
| if (nonce === 2) { | |
| // We want to exercise the case where the function arguments are length 3 | |
| // but the third arg is still not a callback so it runs sync | |
| return crypto.randomInt(0, 2 ** 48 - 1, undefined) as undefined as number | |
| } else { | |
| return crypto.randomInt(0, 2 ** 48 - 1) | |
| } | |
| } | |
Xet Storage Details
- Size:
- 931 Bytes
- Xet hash:
- a85a26277218f2ef52ba4b8a60666a440d5d34ef73248f9f91907c43bf857909
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.