Skip to content

Commit

Permalink
Merge pull request #55 from EOSIO/updating-dependencies
Browse files Browse the repository at this point in the history
update dependencies
  • Loading branch information
Cody Douglass authored May 7, 2019
2 parents 6d7cbe3 + 1a74b71 commit 2063257
Show file tree
Hide file tree
Showing 4 changed files with 6,839 additions and 9,191 deletions.
48 changes: 24 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const ecc = require('eosjs-ecc')

# Include

- Install with: `npm install eosjs-ecc`
- Install with: `yarn add eosjs-ecc`
- Html script tag, see [releases](https://github.com/EOSIO/eosjs-ecc/releases) for the correct **version** and its matching script **integrity** hash.

```html
Expand Down Expand Up @@ -45,6 +45,7 @@ const ecc = require('eosjs-ecc')
### Table of Contents

- [wif](#wif)
- [pubkey](#pubkey)
- [ecc](#ecc)
- [initialize](#initialize)
- [unsafeRandomKey](#unsaferandomkey)
Expand Down Expand Up @@ -79,14 +80,19 @@ const ecc = require('eosjs-ecc')
- [sha256](#sha256)
- [Parameters](#parameters-10)
- [Examples](#examples-8)
- [pubkey](#pubkey)

## wif

[Wallet Import Format](https://en.bitcoin.it/wiki/Wallet_import_format)

Type: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)

## pubkey

EOSKey..

Type: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)

## ecc

### initialize
Expand All @@ -97,7 +103,7 @@ generation.

Initialization happens once even if called multiple times.

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)**
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)**

### unsafeRandomKey

Expand All @@ -122,7 +128,7 @@ console.log('Public Key:\t', ecc.privateToPublic(privateKey)) // EOSkey...
})
```

Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[wif](#wif)>**
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[wif](#wif)>**

### seedPrivate

Expand All @@ -138,13 +144,13 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
ecc.seedPrivate('secret') === wif
```

Returns **[wif](#wif)**
Returns **[wif](#wif)**

### privateToPublic

#### Parameters

- `wif` **[wif](#wif)**
- `wif` **[wif](#wif)**
- `pubkey_prefix` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** public key prefix (optional, default `'EOS'`)

#### Examples
Expand All @@ -153,7 +159,7 @@ Returns **[wif](#wif)**
ecc.privateToPublic(wif) === pubkey
```

Returns **[pubkey](#pubkey)**
Returns **[pubkey](#pubkey)**

### isValidPublic

Expand All @@ -174,7 +180,7 @@ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/

#### Parameters

- `wif` **[wif](#wif)**
- `wif` **[wif](#wif)**

#### Examples

Expand All @@ -190,8 +196,8 @@ Create a signature using data or a hash.

#### Parameters

- `data` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Buffer](https://nodejs.org/api/buffer.html))**
- `privateKey` **([wif](#wif) | PrivateKey)**
- `data` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Buffer](https://nodejs.org/api/buffer.html))**
- `privateKey` **([wif](#wif) | PrivateKey)**
- `encoding` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** data encoding (if string) (optional, default `'utf8'`)

#### Examples
Expand All @@ -207,7 +213,7 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
#### Parameters

- `dataSha256` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Buffer](https://nodejs.org/api/buffer.html))** sha256 hash 32 byte buffer or string
- `privateKey` **([wif](#wif) | PrivateKey)**
- `privateKey` **([wif](#wif) | PrivateKey)**
- `encoding` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** dataSha256 encoding (if string) (optional, default `'hex'`)

Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** string signature
Expand All @@ -219,8 +225,8 @@ Verify signed data.
#### Parameters

- `signature` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Buffer](https://nodejs.org/api/buffer.html))** buffer or hex string
- `data` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Buffer](https://nodejs.org/api/buffer.html))**
- `pubkey` **([pubkey](#pubkey) | PublicKey)**
- `data` **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Buffer](https://nodejs.org/api/buffer.html))**
- `pubkey` **([pubkey](#pubkey) | PublicKey)**
- `encoding` (optional, default `'utf8'`)
- `hashData` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** sha256 hash data before verify (optional, default `true`)

Expand All @@ -230,7 +236,7 @@ Verify signed data.
ecc.verify(signature, 'I am alive', pubkey) === true
```

Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)**

### recover

Expand All @@ -248,7 +254,7 @@ Recover the public key used to create the signature.
ecc.recover(signature, 'I am alive') === pubkey
```

Returns **[pubkey](#pubkey)**
Returns **[pubkey](#pubkey)**

### recoverHash

Expand All @@ -258,7 +264,7 @@ Returns **[pubkey](#pubkey)**
- `dataSha256` **([String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Buffer](https://nodejs.org/api/buffer.html))** sha256 hash 32 byte buffer or hex string
- `encoding` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** dataSha256 encoding (if dataSha256 is a string) (optional, default `'hex'`)

Returns **PublicKey**
Returns **PublicKey**

### sha256

Expand All @@ -280,12 +286,6 @@ ecc.sha256(Buffer.from('02208b', 'hex')) === '29a23..'

Returns **([string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String) \| [Buffer](https://nodejs.org/api/buffer.html))** Buffer when encoding is null, or string

## pubkey

EOSKey..

Type: [string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)

# Usage (Object API)

```js
Expand All @@ -311,8 +311,8 @@ pubkey = PrivateKey.fromString(privateWif).toPublic().toString()
```bash
git clone https://github.com/EOSIO/eosjs-ecc.git
cd eosjs-ecc
npm install
npm run build_browser
yarn
yarn build_browser
# builds: ./dist/eosjs-ecc.js
# Verify release hash
```
Expand Down
Loading

0 comments on commit 2063257

Please sign in to comment.