Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 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 @@ -97,7 +97,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 +122,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 +138,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 +153,7 @@ Returns **[wif](#wif)**
ecc.privateToPublic(wif) === pubkey
```

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

### isValidPublic

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

#### Parameters

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

#### Examples

Expand All @@ -190,8 +190,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 +207,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 +219,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 +230,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 +248,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 +258,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 Down Expand Up @@ -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