Skip to content

Commit

Permalink
chore(README.md,package.json): Change name to 'secretbox-encoding'
Browse files Browse the repository at this point in the history
  • Loading branch information
jwerle committed Oct 1, 2019
1 parent bb4b2fd commit eb31f3c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
xsalsa20-poly1305-encoding
==========================
secretbox-encoding
==================

> XSalsa20 Poly1305 codec that implements the abstract-encoding interface.
> [XSalsa20 Poly1305][secretbox] codec that implements the [abstract-encoding][abstract-encoding] interface.
## Installation

```sh
$ npm install xsalsa20-poly1305-encoding
$ npm install secretbox-encoding
```

## Usage

```js
const codec = require('xsalsa20-poly1305-encoding')(nonce, secretKey)
const codec = require('secretbox-encoding')(nonce, secretKey)

// encode a value
buffer = codec.encode(value)
Expand All @@ -25,7 +25,7 @@ value = codec.decode(buffer)

```js
const crypto = require('crypto')
const Codec = require('xsalsa20-poly1305-encoding')
const Codec = require('secretbox-encoding')

const nonce = crypto.randomBytes(24)
const key = crypto.randomBytes(32)
Expand Down Expand Up @@ -54,7 +54,7 @@ const message = codec.decode(encoded) // { data: 'hello world' }

## API

### `codec = require('xsalsa20-poly1305-encoding')([nonce,] secretKey[, opts])`
### `codec = require('secretbox-encoding')([nonce,] secretKey[, opts])`

Create a codec object from a 24 byte `nonce` and 32 byte `secretKey`. If
only a 32 byte `nonce` is given, it is treated as a `secretKey`.
Expand Down Expand Up @@ -103,3 +103,7 @@ const length = codec.encodingLength('hello world') // 11
## License

MIT


[abstract-encoding]: https://github.com/mafintosh/abstract-encoding
[secretbox]: https://download.libsodium.org/doc/secret-key_cryptography/secretbox
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "xsalsa20-poly1305-encoding",
"name": "secretbox-encoding",
"version": "0.1.0",
"description": "XSalsa20 Poly1305 codec that implements the abstract-encoding interface.",
"main": "index.js",
Expand All @@ -24,10 +24,10 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/jwerle/xsalsa20-poly1305-encoding.git"
"url": "git+https://github.com/jwerle/secretbox-encoding.git"
},
"bugs": {
"url": "https://github.com/jwerle/xsalsa20-poly1305-encoding/issues"
"url": "https://github.com/jwerle/secretbox-encoding/issues"
},
"homepage": "https://github.com/jwerle/xsalsa20-poly1305-encoding#readme"
"homepage": "https://github.com/jwerle/secretbox-encoding#readme"
}

0 comments on commit eb31f3c

Please sign in to comment.