From 438778295e7e54451c293abc5b144ee21d9b3ca8 Mon Sep 17 00:00:00 2001 From: Weiliang Li Date: Wed, 28 Nov 2018 21:24:59 +0900 Subject: [PATCH] Update README (#11) --- README.md | 46 ++++++++++++++++++++++++++++++---------------- package.json | 2 +- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 03359fa..4f7345b 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,13 @@ [![Circle CI](https://img.shields.io/circleci/project/kigawas/eciesjs/master.svg)](https://circleci.com/gh/kigawas/eciesjs) [![Codecov](https://img.shields.io/codecov/c/github/kigawas/eciesjs.svg)](https://codecov.io/gh/kigawas/eciesjs) -Elliptic Curve Integrated Encryption Scheme for secp256k1 +Elliptic Curve Integrated Encryption Scheme for secp256k1, written in TypeScript with minimal dependencies. -This is the JavaScript version of [eciespy](https://github.com/kigawas/eciespy), please go to there for detailed mechanism documentation. +This is the JavaScript/TypeScript version of [eciespy](https://github.com/kigawas/eciespy), you may go there for documentation about detailed mechanism. ## Install -Install with `npm install eciesjs` (only [`secp256k1`](https://github.com/cryptocoinjs/secp256k1-node) is the dependency). +Install with `npm install eciesjs` ([`secp256k1`](https://github.com/cryptocoinjs/secp256k1-node) is the only dependency). ## Quick Start @@ -51,23 +51,37 @@ Returns: **Buffer** ### `PrivateKey` +- Methods + +```typescript +static fromHex(hex: string): PrivateKey; +constructor(secret?: Buffer); +toHex(): string; +ecdh(pub: PublicKey): Buffer; +equals(other: PrivateKey): boolean; +``` + +- Properties + ```typescript - static fromHex(hex: string): PrivateKey; - readonly secret: Buffer; - readonly publicKey: PublicKey; - constructor(secret?: Buffer); - toHex(): string; - ecdh(pub: PublicKey): Buffer; - equals(other: PrivateKey): boolean; +readonly secret: Buffer; +readonly publicKey: PublicKey; ``` ### `PublicKey` +- Methods + +```typescript +static fromHex(hex: string): PublicKey; +constructor(buffer: Buffer); +toHex(compressed?: boolean): string; +equals(other: PublicKey): boolean; +``` + +- Properties + ```typescript - static fromHex(hex: string): PublicKey; - readonly uncompressed: Buffer; - readonly compressed: Buffer; - constructor(buffer: Buffer); - toHex(compressed?: boolean): string; - equals(other: PublicKey): boolean; +readonly uncompressed: Buffer; +readonly compressed: Buffer; ``` diff --git a/package.json b/package.json index b44b854..b8cc377 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "type": "git", "url": "https://github.com/kigawas/eciesjs.git" }, - "version": "0.1.0", + "version": "0.1.1", "devDependencies": { "@types/chai": "^4.1.7", "@types/mocha": "^5.2.5",