apiref
@dtinth/encrypted@0.3.1

CipherDecipher.encrypt()  MethodSignature

Encrypts the data.

Signature

encrypt(data: any): string

Example

encrypted.encrypt("AKIAYVP4CIPPB7TRITNC")
// => "H7WwoocLJnbDgKk1+5vH47JvLp49FQZn.0KlZf2igrh8hzoKG9zGv1t9rmrUZ4PYftuOy3lV96ygthjpFBlQ="

Parameters

ParameterTypeDescription
dataany

The data to encrypt, which can be any JSON-serializable data

(Returns)string

The encrypted payload, a string