Skip to content

The cipher of PersonalData on node:crypto. WebCrypto, the default, is asynchronous, which makes each personal field cost a trip through the event loop. This one encrypts and decrypts synchronously, in the same format, so data written with either reads with the other.

const Keys = PersonalData.layerSql().pipe(
Layer.provide(PersonalData.layerMasterKeyConfig()),
Layer.provide(PersonalDataNode.layerCipher)
)

It lives in a module of its own so that code for browsers never imports node:crypto.

const cipher: Cipher

Defined in: src/PersonalDataNode.ts:27

AES-256-GCM on node:crypto.


const layerCipher: Layer.Layer<never>

Defined in: src/PersonalDataNode.ts:68

Provides cipher to the keys and master keys built with it.