edfcore 0.4.320 → 0.4.322

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.
@@ -109,5 +109,5 @@ export declare const SIGNAL_FIELD_BLOCK_OFFSETS: {
109
109
  readonly reserved: 224;
110
110
  };
111
111
  /** Published package version. Kept in sync with package.json by a test. */
112
- export declare const VERSION = "0.4.320";
112
+ export declare const VERSION = "0.4.322";
113
113
  //# sourceMappingURL=constants.d.ts.map
package/dist/constants.js CHANGED
@@ -79,5 +79,5 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
79
79
  reserved: 224,
80
80
  };
81
81
  /** Published package version. Kept in sync with package.json by a test. */
82
- export const VERSION = '0.4.320';
82
+ export const VERSION = '0.4.322';
83
83
  //# sourceMappingURL=constants.js.map
package/docs/CHANGELOG.md CHANGED
@@ -6,6 +6,35 @@ alone does not tell you whether you were affected.
6
6
  edfcore is pre-1.0. Patch releases have carried behaviour changes where the old behaviour was a
7
7
  defect; those are called out below.
8
8
 
9
+ ## 0.4.322
10
+
11
+ - **Fixed** a wrong claim on `edf-format.md`. It named `|0`, `<<` and `>>>` together as operators
12
+ that "wrap it negative without warning" past 2^31. `>>>` is the unsigned shift and never returns
13
+ a negative number: it truncates to 32 bits and keeps handing back a plausible offset until 2^32,
14
+ then a wrong one. Grouping it with the other two described the safer failure and hid the more
15
+ dangerous one — a negative offset is caught by the first bounds check it meets, and a positive
16
+ wrong one is not.
17
+ - Found while writing 0.4.321, whose demonstration would not assert what the sentence said. The
18
+ corrected wording is now pinned by that test, and both behaviours are shown at the sizes where
19
+ they actually occur.
20
+
21
+ ## 0.4.321
22
+
23
+ - **Added** a guard for the offset rule `edf-format.md` states: offsets stay in plain floats, which
24
+ are exact to 2^53, because a data offset in a multi-gigabyte BDF crosses 2^31 and a bitwise
25
+ operator wraps it negative there without warning. Nothing checked it, and the failure is the
26
+ silent kind — a 22-hour BDF passes 2^31 bytes about nine hours in, so a truncated offset would
27
+ read plausible samples from the wrong place for the whole back half of the recording.
28
+ - Not a ban: `decode/digital.ts` assembles every sample with `|` and `<<` and must, and the same
29
+ page prints those two lines as the definition of the format. The guard is an inventory instead —
30
+ every bitwise operator in `src/` has to sit in one of three modules with a written reason, which
31
+ makes adding a fourth a deliberate act. `record-index.ts` is one of the three, and its entry
32
+ records why `(low + high) >> 1` is safe: the record count comes from an eight-character header
33
+ field, so the index cannot approach 2^30.
34
+ - The demonstration corrects a detail the page leaves implicit. `| 0` and `>>` wrap the offset
35
+ negative at 2^31, but `>>>` is unsigned and returns something plausible until 2^32 — about
36
+ eighteen hours into the same recording — which is the more dangerous of the two behaviours.
37
+
9
38
  ## 0.4.320
10
39
 
11
40
  - **Extended** 0.4.319 to the second copy of the harness table. `scripts/golden/README.md` carries
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edfcore",
3
- "version": "0.4.320",
3
+ "version": "0.4.322",
4
4
  "description": "Modern, typed, zero-dependency reader for EDF, EDF+, BDF and BDF+ biosignal files. Works in browsers and Node with true random access.",
5
5
  "keywords": [
6
6
  "edf",
package/src/constants.ts CHANGED
@@ -93,4 +93,4 @@ export const SIGNAL_FIELD_BLOCK_OFFSETS = {
93
93
  } as const;
94
94
 
95
95
  /** Published package version. Kept in sync with package.json by a test. */
96
- export const VERSION = '0.4.320';
96
+ export const VERSION = '0.4.322';