Skip to content

Commit 316387e

Browse files
committed
chore(ncrypt-js): update README.md
- update and improve README.md file - remove tsconfig.json from release files - add weekly download badge
1 parent a3976a6 commit 316387e

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# NcryptJs
22

3-
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ajimae/ncrypt-js/release.yml) [![Coverage Status](https://coveralls.io/repos/github/ajimae/ncrypt-js/badge.svg)](https://coveralls.io/github/ajimae/ncrypt-js) [![NPM](https://img.shields.io/npm/l/ncrypt-js)](https://www.npmjs.com/package/ncrypt-js/v/2.0.0#license)
3+
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/ajimae/ncrypt-js/release.yml) [![Coverage Status](https://coveralls.io/repos/github/ajimae/ncrypt-js/badge.svg)](https://coveralls.io/github/ajimae/ncrypt-js) ![NPM Downloads](https://img.shields.io/npm/dw/ncrypt-js)
44

5-
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/ajimae/ncrypt-js)](https://github.com/ajimae/ncrypt-js/releases) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/ajimae/ncrypt-js)](https://github/languages/code-size/ajimae/ncrypt-js) [![GitHub issues](https://img.shields.io/github/issues/ajimae/ncrypt-js)](https://github.com/ajimae/ncrypt-js/issues)
5+
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/ajimae/ncrypt-js)](https://github.com/ajimae/ncrypt-js/releases) [![GitHub code size in bytes](https://img.shields.io/github/languages/code-size/ajimae/ncrypt-js)](https://github/languages/code-size/ajimae/ncrypt-js) [![GitHub issues](https://img.shields.io/github/issues/ajimae/ncrypt-js)](https://github.com/ajimae/ncrypt-js/issues) [![NPM](https://img.shields.io/npm/l/ncrypt-js)](https://www.npmjs.com/package/ncrypt-js/v/2.0.0#license)
66

77
**_NcryptJs_** is a light weight javascript data encryption and decryption library. This library implements the nodejs default crypto functionality as a mid-channel cipher in addition to a simple and elegant custom data encoding and encryption algorithm.
88

@@ -85,7 +85,7 @@ var { ncrypt } = require("ncrypt-js");
8585

8686
### Using randomString method
8787

88-
The `randomString()` static method can generate [random bytes](https://nodejs.org/api/crypto.html#cryptorandombytessize-callback) encoded into a `hexadecimal` or `base64` strings. This string can be useful in a variety of use cases e.g to generate database ids, to generate a unique string for a list, a unique serial strings etc.
88+
The `randomString()` static method can generate [random bytes](https://nodejs.org/api/crypto.html#cryptorandombytessize-callback) encoded into a `hexadecimal` or `base64` strings. This string can be useful in a variety of use cases e.g to generate database ids, to generate a unique string for a list, a unique serial strings, api keys etc.
8989

9090
```ts
9191
var { ncrypt } = require('ncrypt-js'); // or import ncrypt from 'ncrypt-js'
@@ -120,7 +120,7 @@ console.log("Encryption process...");
120120
console.log("Plain Text : " + data);
121121
console.log("Cipher Text : " + encryptedData);
122122

123-
// decrypted super encrypted string here
123+
// decrypting the encrypted super sensitive data here
124124
var decryptedData = decrypt(encryptedData);
125125
console.log("... and then decryption...");
126126
console.log("Decipher Text : " + decryptedData);
@@ -189,7 +189,7 @@ If you are using any sort of environmental key-value store, e.g `.env` and for a
189189
KEY='sshhhh this is a super secret key'
190190
191191
# used internally to set the `encoding` - ['base64' | 'binary' | 'hex' | 'ucs-2' | 'ucs2' | 'utf16le']
192-
NCRPT_ENC='hex'
192+
NCRYPT_ENC='hex'
193193
194194
SECRET='this is our hashing secret'
195195
```
@@ -200,7 +200,9 @@ var { ncrypt } = require('ncrypt-js');
200200
var { encrypt, decrypt } = new ncrypt(process.env.SECRET);
201201
...
202202
```
203-
_**NOTE:** The secret is required to decrypt the encrypted data, if the secret used to encrypt a specific data is lost, then that data cannot be decripted._
203+
_**NOTE:** The secret is required to decrypt the encrypted data, if the secret used to encrypt a specific data is lost, then that data cannot be decrypted._
204+
205+
_Same goes for encoding, if data was encrypted using `hex` encoding format, decrypting with a `base64` encoding or other encoding format and vise versa will not work_
204206

205207
## Built With
206208

@@ -210,7 +212,7 @@ Written in [TypeScript](https://typscriptlang.org/), built into ECMAScript 5 usi
210212

211213
To contribute, simply fork this project, and issue a pull request.
212214

213-
## Version Management
215+
## Versioning
214216

215217
We use [SemVer](http://semver.org/) for version management. For the versions available, see the [tags on this repository](https://github.com/ajimae/ncrypt-js/tags).
216218

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ncrypt-js",
3-
"version": "2.1.1",
3+
"version": "2.1.2",
44
"description": "a light weight javascript data encryption and decryption library",
55
"main": "dist/index.js",
66
"scripts": {
@@ -51,7 +51,6 @@
5151
"files": [
5252
"dist",
5353
"package.json",
54-
"LICENSE",
55-
"tsconfig.json"
54+
"LICENSE"
5655
]
5756
}

src/ncrypt.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default class Ncrypt {
4545
constructor(secret: string) {
4646
this.secret = secret;
4747

48-
// bind public instnace methods
48+
// bind public instance methods
4949
this.encrypt = this.encrypt.bind(this);
5050
this.decrypt = this.decrypt.bind(this);
5151
}

0 commit comments

Comments
 (0)