Skip to content

Commit

Permalink
1.0.1 updates
Browse files Browse the repository at this point in the history
  • Loading branch information
spaceaardvark committed Nov 17, 2020
1 parent 5398c42 commit 8ad75be
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 156 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[*.js]
[*.{js,ts}]
indent_size = 2
indent_style = space

Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.0.1] - 2020-11-17
### Added
- `CHANGELOG.md` :wink:
- `index.d.ts`
- Only publish `index.js` and `index.d.ts` to NPM.

## [1.0.0] - 2020-11-17
### Added
- Everything! First release. :tada:
37 changes: 37 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
declare module "@spaceaardvark/encrypt" {
/**
* Encrypt a string with a password.
*
* @param {string} password - plain text password
* @param {string} text - text to encrypt
* @returns {string}
*/
export function encrypt(
password: string,
text: string,
): string;
/**
* Encrypt a string with a password and a custom number of KDF iterations.
*
* @param {string} password - plain text password
* @param {number} iterations - iterations used to generate key
* @param {string} text - text to encrypt
* @returns {string}
*/
export function encryptIterations(
password: string,
iterations: number,
text: string,
): string;
/**
* Decrypt a string encrypted with encrypt().
*
* @param {string} password - password used to generate encryption key
* @param {string} encrypted- string produced by encrypt()
* @returns {string}
*/
export function decrypt(
password: string,
encrypted: string,
): string;
}
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const decrypt1 = async (password, manifest, payload) => {
ENCRYPTION_VERSION["1"].decrypt = decrypt1;

/**
* Decrypt text encrypted with encrypt().
* Decrypt a string encrypted with encrypt().
*
* @param {string} password - password used to generate encryption key
* @param {string} encrypted- string produced by encrypt()
Expand Down
Loading

0 comments on commit 8ad75be

Please sign in to comment.