// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. /// /// declare var crypto: Crypto; declare interface Crypto { readonly subtle: SubtleCrypto; getRandomValues< T extends | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | null, >( array: T, ): T; randomUUID(): string; } interface Algorithm { name: string; } /** This Web Crypto API interface provides a number of low-level cryptographic functions. It is accessed via the Crypto.subtle properties available in a window context (via Window.crypto). */ interface SubtleCrypto { digest( algorithm: AlgorithmIdentifier, data: | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array | DataView | ArrayBuffer, ): Promise; } declare var SubtleCrypto: { prototype: SubtleCrypto; new (): SubtleCrypto; }; type AlgorithmIdentifier = string | Algorithm;