cripta
TypeScript icon, indicating that this package has built-in type declarations

0.1.8 • Public • Published

Criptλ
Start new PR in StackBlitz Codeflownpm package


Install

# bun
bun i cripta

# pnpm
pnpm i cripta

# npm
npm i cripta

# yarn
yarn i cripta

Usage

import { cripta } from 'cripta'

const instance = cripta({ key: 'your-secret-key' })

const encoded = instance.encode('hic sunt dracones')
console.log('Encoded: ', encoded)
console.log('Decoded: ', instance.decode(encoded))

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 = instance.encode({
  name: 'John Doe',
  email: 'john@example.com'
})

console.log('Encoded object: ', encoded)

// retrieve the object from encoded value
const decoded = instance.decode(encoded)
console.log('Decoded object: ', decoded)

License

This package is licensed under the MIT license © Zunq

Package Sidebar

Install

npm i cripta

Homepage

zunq.dev

Weekly Downloads

10

Version

0.1.8

License

MIT

Unpacked Size

26.8 kB

Total Files

5

Last publish

Collaborators

  • nicxlau