---
title: Crypto
summary: The Crypto interface as specified by WHATWG Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives.
url: https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/globals/interface.Crypto/
---

**Kind:** Interface  
**Module:** [globals](https://www.fastly.com/documentation/reference/compute/sdks/javascript/js-compute/globals/)  
**Package:** @fastly/js-compute 4.0.1  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2381

The Crypto interface as [specified by WHATWG](https://w3c.github.io/webcrypto/#crypto-interface)
Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives.

**See also**

- [Crypto on MDN](https://developer.mozilla.org/en-US/docs/Web/API/Crypto)

## Constructor

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2392

```javascript
new Crypto()
```

## Properties

### subtle

**Type:** `SubtleCrypto`  
**Flags:** read-only  
**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2382

## Methods

### getRandomValues

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2383

```javascript
getRandomValues(array: T): T
```

**Parameters**

- `array`: `T`

**Returns**

`T`

### randomUUID

**Source:** https://github.com/fastly/js-compute-runtime/blob/70cf30af4e657879b2d1e7eafab880e39e3a3f7d/types/globals.d.ts#L2384

```javascript
randomUUID(): string
```

**Returns**

`string`
