Skip to content

Latest commit

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Cript位
Start new PR in StackBlitz Codeflownpm package


Install

bun i cripta

Usage

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: 'john@example.com'
}, 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 licenseHUB

About

馃 A layer of encryption a little too judicious

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Used by

Contributors

Languages