hypercore 10.0.0-alpha.1 → 10.0.0-alpha.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,4 @@
1
1
  name: Build Status
2
-
3
2
  on:
4
3
  push:
5
4
  branches:
@@ -11,7 +10,7 @@ jobs:
11
10
  build:
12
11
  strategy:
13
12
  matrix:
14
- node-version: [14.x]
13
+ node-version: [lts/*]
15
14
  os: [ubuntu-latest, macos-latest, windows-latest]
16
15
  runs-on: ${{ matrix.os }}
17
16
  steps:
package/README.md CHANGED
@@ -63,7 +63,8 @@ Note that `tree`, `data`, and `bitfield` are normally heavily sparse files.
63
63
  createIfMissing: true, // create a new Hypercore key pair if none was present in storage
64
64
  overwrite: false, // overwrite any old Hypercore that might already exist
65
65
  valueEncoding: 'json' | 'utf-8' | 'binary', // defaults to binary
66
- keyPair: kp // optionally pass the public key and secret key as a key pair
66
+ keyPair: kp, // optionally pass the public key and secret key as a key pair
67
+ encryptionKey: k // optionally pass an encryption key to enable block encryption
67
68
  }
68
69
  ```
69
70
 
@@ -113,6 +114,7 @@ A range can have the following properties:
113
114
  {
114
115
  start: startIndex,
115
116
  end: nonInclusiveEndIndex,
117
+ blocks: [index1, index2, ...],
116
118
  linear: false // download range linearly and not randomly
117
119
  }
118
120
  ```
@@ -125,6 +127,12 @@ To download the full core continously (often referred to as non sparse mode) do
125
127
  core.download({ start: 0, end: -1 })
126
128
  ```
127
129
 
130
+ To downloaded a discrete range of blocks pass a list of indices.
131
+
132
+ ```js
133
+ core.download({ blocks: [4, 9, 7] });
134
+ ```
135
+
128
136
  To cancel downloading a range simply destroy the range instance.
129
137
 
130
138
  ``` js
@@ -195,6 +203,10 @@ In contrast to `core.key` this key does not allow you to verify the data but can
195
203
 
196
204
  Populated after `ready` has been emitted. Will be `null` before the event.
197
205
 
206
+ #### `core.encryptionKey`
207
+
208
+ Buffer containing the optional block encryption key of this core. Will be `null` unless block encryption is enabled.
209
+
198
210
  #### `core.length`
199
211
 
200
212
  How many blocks of data are available on this core?
@@ -213,6 +225,10 @@ What is the current fork id of this core?
213
225
 
214
226
  Populated after `ready` has been emitted. Will be `0` before the event.
215
227
 
228
+ #### `core.padding`
229
+
230
+ How much padding is applied to each block of this core? Will be `0` unless block encryption is enabled.
231
+
216
232
  #### `const stream = core.replicate(isInitiatorOrReplicationStream)`
217
233
 
218
234
  Create a replication stream. You should pipe this to another Hypercore instance.