Skip to content

Commit

Permalink
doc(README.md): Update verify function signature documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed May 19, 2018
1 parent 895a0f9 commit 9217048
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const bytes = crypto.randomBytes(32)
const hash = crypto.blake2b(Buffer.from("message"))
const { publicKey, secretKey } = crypto.keyPair()
const signature = crypto.sign(message, secretKey)
const verified = crypto.verify(message, signature, publicKey)
const verified = crypto.verify(signature, message, publicKey)
const buffer = crypto.uint64.encode(80)
const number = crypto.uint64.decode(buffer) // 80
```
Expand Down Expand Up @@ -85,7 +85,7 @@ const { publicKey, secretKey } = crypto.keyPair()
const signature = crypto.sign(Buffer.from("hello"), secretKey)
```

### `crypto.verify(message, signature, publicKey)`
### `crypto.verify(signature, message, publicKey)`

Verify signature for a message signed with a given
public key. This function will throw a `TypeError` if given incorrect
Expand All @@ -96,7 +96,7 @@ internally.
const { publicKey, secretKey } = crypto.keyPair()
const message = Buffer.from("hello")
const signature = crypto.sign(message, secretKey)
const verified = crypto.verify(message, signature, publicKey)
const verified = crypto.verify(signature, message, publicKey)
if (verified) {
// message was signed with secret key corresponding to the
// given public that generated the given signature
Expand Down

0 comments on commit 9217048

Please sign in to comment.