cripta
v0.260915.0
Published
A layer of encryption a little too judicious
Maintainers
Readme
Install
bun i criptaUsage
import { config, encode, decode } from 'cripta'
const opts = await config({ key: 'your-secret-key' })
const encoded = await encode('hic sunt dracones', opts)
console.log('Encoded: ', encoded)
console.log('Decoded: ', await decode(encoded, opts))The Cripta can encrypt all primitive types: array, object, string, number, bigint, boolean, Symbol, undefined and null.
See an example of object encryption:
// encoding
const encoded = await encode({
name: 'John Doe',
email: '[email protected]'
}, opts)
console.log('Encoded object: ', encoded)
// retrieve the object from encoded value
const decoded = await decode(encoded, opts)
console.log('Decoded object: ', decoded)License
This package is licensed under the MIT license © HUB
