Skip to main content
Generated from the same public contract that feeds the Monaco editor. Declaration-marked deprecated compatibility methods are intentionally excluded. Do not edit this page manually.
This page contains 33 methods. Search the docs for an exact method name, or use this index:

util.sleep()

Waits asynchronously, capped at 60 seconds per call.

Signature

Example

util.aesDecrypt()

AES decrypt helper. Ciphertext: at most 5592464 base64 characters; passphrase: at most 4096 UTF-16 code units.

Signature

Example

util.aesEncrypt()

AES encrypt helper. Payload: at most 1048576 UTF-16 code units; passphrase: at most 4096.

Signature

Example

util.compareHash()

Compares a value against a password hash. Password: at most 4096 UTF-16 code units; unsupported scrypt work factors return false.

Signature

Example

util.isBase64()

Checks whether a value is base64.

Signature

Example

util.decodeBase64()

Decodes a base64 string.

Signature

Example

util.encodeBase64()

Encodes a string to base64.

Signature

Example

util.generateHash()

Generates a password hash. Password: at most 4096 UTF-16 code units.

Signature

Example

util.isUUID()

Validates UUID shape.

Signature

Example

util.randomUUID()

Generates a random UUIDv7.

Signature

Example

util.getUUID()

Returns a random UUIDv7 with no arguments, or a deterministic UUIDv5 only when both value and namespace are supplied. Do not generate IDs for server-created platform resources; use this only for caller-owned data values.

Signature

Example

util.hashObject()

Creates a stable hash from an object.

Signature

Example

util.sha1()

Synchronous SHA-1 hash. Payload: at most 5242880 UTF-8 bytes (5 MiB). Invalid types/options throw TypeError; size/range throws RangeError.

Signature

Example

util.sha256()

Synchronous SHA-256 hash. Payload: at most 5242880 UTF-8 bytes (5 MiB). Invalid types/options throw TypeError; size/range throws RangeError.

Signature

Example

util.md5()

Synchronous MD5 hash. Payload: at most 5242880 UTF-8 bytes (5 MiB). Invalid types/options throw TypeError; size/range throws RangeError.

Signature

Example

util.timingSafeEqual()

Synchronous timing-safe comparison. Each input: at most 65536 bytes (UTF-8 for strings). Invalid types/options throw TypeError; size/range throws RangeError.

Signature

Example

util.hmac()

Synchronous HMAC signature. Payload: at most 5242880 bytes; secret: at most 65536 UTF-8 bytes. Invalid types/options throw TypeError; size/range throws RangeError.

Signature

Example

util.verifyHmacSignature()

Synchronous HMAC verification. Payload: at most 5242880 bytes; secret and signature: at most 65536 UTF-8 bytes each. Invalid types/options throw TypeError; size/range throws RangeError.

Signature

Example

util.base64UrlEncode()

Encodes base64url.

Signature

Example

util.base64UrlDecode()

Decodes base64url.

Signature

Example

util.randomBytes()

Synchronously generates random bytes as a string. Size: integer 0..65536 bytes before encoding. Invalid types/options throw TypeError; size/range throws RangeError.

Signature

Example

util.randomInt()

Synchronously generates a random integer in the inclusive min..max range. Bounds and max + 1 must be safe integers; range size must be smaller than 2^48. Invalid types/options throw TypeError; size/range throws RangeError.

Signature

Example

util.randomString()

Generates a random string. Length: integer 0..65536. Alphabet: 1..65536 UTF-16 code units.

Signature

Example

util.otp()

Generates a numeric one-time code. Length: integer 0..65536.

Signature

Example

util.validate()

Validates a payload with the platform schema validator used by Endpoints. Notes:
  • Prefer enum/const, types, lengths, numeric bounds and supported date/time formats over regex when equivalent.
  • Use regex only for a required text pattern; even simple patterns can materially increase Endpoint guard preparation time.
  • Use profile: ‘strict’ for new schemas; omitted profiles retain legacy behavior.
  • required controls presence, nullable controls null, and empty controls empty strings and arrays.
  • Use additionalProperties: ‘allow’, ‘strip’ or ‘reject’ for unknown fields.
  • Legacy whitelist: true retains unknown fields. With whitelist: false, whitelistErrors: false removes them; true reports errors.
  • The result contains valid, errors, issues and value. Structured issues expose code, path, message and optional params.
  • After success, use value so configured field removal is respected.
  • Input, schema and execution limits apply; cyclic data is rejected. Capacity or execution failures can reject the Promise.

Signature

Example

util.jwtDecode()

Decodes a JWT without verifying it.

Signature

Example

util.jwtSign()

Signs a JWT.

Signature

Example

util.jwtVerify()

Verifies a JWT.

Signature

Example

util.rsaDecrypt()

Decrypts with RSA-OAEP and SHA-256 asynchronously. PEM import (including passphrase processing) still executes synchronously.

Signature

Example

util.rsaEncrypt()

Encrypts with RSA-OAEP and SHA-256 asynchronously. PEM import and data encoding still execute synchronously.

Signature

Example

util.rsaGeneratePair()

Generates an RSA key pair. Asynchronous; modulusLength: multiple of 256 in 1024..4096; passphrase: at most 4096 code units.

Signature

Example

util.rsaSign()

Signs data with RSA-PSS and SHA-256 asynchronously. PEM import and input conversion can still occupy the event loop.

Signature

Example

util.rsaVerify()

Verifies an RSA-PSS SHA-256 signature asynchronously, preserving automatic salt-length detection.

Signature

Example

Last modified on September 13, 2026