0.0.6 • Published 3 years ago

@hsjs/vault v0.0.6

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

@hsjs/vault

Install

yarn add @hsjs/vault

Usage

import { encrypt, decrypt } from "@hsjs/vault";

encrypt("SecretPassw0rd", "YourPlaintext", { b64Output: true });
// returns "eyJpdiI6...itTdklKeFlmc1RTcz0ifQ=="

decrypt("SecretPassw0rd", "eyJpdiI6...itTdklKeFlmc1RTcz0ifQ==", {
  b64Input: true,
});
// returns "YourPlaintext"

API

encrypt

function encrypt(
  password: string,
  plaintext: string,
  opts: VaultOptions = {}
): string;

type VaultOptions = { b64Input?: boolean; b64Output?: boolean };

decrypt

function decrypt(
  password: string,
  ciphertext: string,
  opts: VaultOptions = {}
): string;

type VaultOptions = { b64Input?: boolean; b64Output?: boolean };
0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago