Crypto
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1146
The Web Crypto API provides a set of low-level functions for common cryptographic tasks. The Workers runtime implements the full surface of this API, but with some differences in the supported algorithms compared to those implemented in most browsers.
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Crypto():
Crypto
Returns
Section titled “Returns”Crypto
Properties
Section titled “Properties”DigestStream
Section titled “DigestStream”DigestStream: typeof
DigestStream
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1177
subtle
Section titled “subtle”
readonlysubtle:SubtleCrypto
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1153
The Crypto.subtle read-only property returns a cryptographic operations.
Available only in secure contexts.
Methods
Section titled “Methods”getRandomValues()
Section titled “getRandomValues()”getRandomValues<
T>(buffer):T
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1159
The Crypto.getRandomValues() method lets you get cryptographically strong random values.
Type Parameters
Section titled “Type Parameters”T extends Uint8Array<ArrayBufferLike> | Int8Array<ArrayBufferLike> | Int16Array<ArrayBufferLike> | Uint16Array<ArrayBufferLike> | Int32Array<ArrayBufferLike> | Uint32Array<ArrayBufferLike> | BigInt64Array<ArrayBufferLike> | BigUint64Array<ArrayBufferLike>
Parameters
Section titled “Parameters”buffer
Section titled “buffer”T
Returns
Section titled “Returns”T
randomUUID()
Section titled “randomUUID()”randomUUID():
string
Defined in: node_modules/.pnpm/@cloudflare+workers-types@4.20251118.0/node_modules/@cloudflare/workers-types/index.ts:1176
The randomUUID() method of the Crypto interface is used to generate a v4 UUID using a cryptographically secure random number generator.
Available only in secure contexts.
Returns
Section titled “Returns”string