@multi-serializer/aes
v0.0.1
Published
This project is just a template for creation of new projects
Downloads
106
Readme
This library delivers a AES serializer and deserializer, fit to be used with multi-serializer;
How to Install
npm i @multi-serializer/aes
How to use
By itself:
const aes = new AesStrategy({ key, keyType: AesType.AES256 });
const serialized = await aes.serialize(info); // this result is buffer
const origin = await aes.deserialize(incomingMessage); // this result is also a buffer
Or adding it in the strategy chain of multi-serializer:
const serializer = new Serializer(
new JsonStrategy(),
new GzipStrategy(),
new AesStrategy({ key, keyType: AesType.AES256 }),
new Base64Strategy(),
);
const serialized = await serializer.serialize(info);
const origin = await serializer.deserialize(incomingMessage);
License
Licensed under MIT.