Global object “crypto”

Object > Crypto

The global crypto object provides an implementation of the RandomSource interface that can be used to generate cryptographically secure random numbers.

Type: Crypto extends Object
Constructor: private
Singleton: crypto
Namespace: global
Direct subclasses: None
JSX Support: No

See also:

TS crypto-decrypt.ts [► Run in Playground]
TS crypto-derive.ts [► Run in Playground]
TS crypto.ts [► Run in Playground]



Generates random numbers.

Parameter Type Description
typedArray TypedArray A typed array which will be filled with random numbers. The same array is also returned by this method.

Returns: TypedArray



Type: SubtleCrypto
Settable: No