Interface Crypto

Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives.

MDN Reference

interface Crypto {
    subtle: SubtleCrypto;
    getRandomValues<T>(array: T): T;
    randomUUID(): `${string}-${string}-${string}-${string}-${string}`;
}

Properties

subtle: SubtleCrypto

Available only in secure contexts.

MDN Reference

Methods

  • Type Parameters

    Parameters

    • array: T

    Returns T

  • Available only in secure contexts.

    MDN Reference

    Returns `${string}-${string}-${string}-${string}-${string}`