asn1-ts 9.0.1 → 9.0.3

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.
Files changed (36) hide show
  1. package/README.md +7 -4
  2. package/dist/asn1.mjs +10 -7
  3. package/dist/codecs/ber.mjs +4 -4
  4. package/dist/codecs/cer.mjs +1 -2
  5. package/dist/codecs/der.mjs +1 -2
  6. package/dist/codecs/x690/decoders/decodeObjectIdentifier.mjs +2 -2
  7. package/dist/codecs/x690/decoders/decodeRelativeObjectIdentifier.mjs +2 -2
  8. package/dist/codecs/x690/encoders/encodeDate.mjs +1 -1
  9. package/dist/codecs/x690/encoders/encodeDateTime.mjs +1 -1
  10. package/dist/codecs/x690/encoders/encodeGeneralizedTime.mjs +1 -1
  11. package/dist/codecs/x690/encoders/encodeTimeOfDay.mjs +3 -1
  12. package/dist/codecs/x690/encoders/encodeUTCTime.mjs +1 -1
  13. package/dist/errors.mjs +0 -16
  14. package/dist/functional.mjs +0 -5
  15. package/dist/types/CharacterString.mjs +0 -2
  16. package/dist/types/EmbeddedPDV.mjs +0 -2
  17. package/dist/types/External.mjs +0 -4
  18. package/dist/types/ObjectIdentifier.mjs +0 -1
  19. package/dist/types/TypeIdentifier.mjs +0 -2
  20. package/dist/types/time/DATE-ENCODING.mjs +0 -3
  21. package/dist/types/time/DURATION-EQUIVALENT.mjs +0 -8
  22. package/dist/types/time/DURATION-INTERVAL-ENCODING.mjs +0 -8
  23. package/dist/types/time/HOURS-DIFF-ENCODING.mjs +0 -2
  24. package/dist/types/time/HOURS-ENCODING.mjs +0 -1
  25. package/dist/types/time/HOURS-MINUTES-DIFF-ENCODING.mjs +0 -3
  26. package/dist/types/time/HOURS-MINUTES-ENCODING.mjs +0 -2
  27. package/dist/types/time/TIME-OF-DAY-DIFF-ENCODING.mjs +0 -4
  28. package/dist/types/time/TIME-OF-DAY-ENCODING.mjs +0 -3
  29. package/dist/types/time/TIME-OF-DAY-FRACTION-DIFF-ENCODING.mjs +0 -5
  30. package/dist/types/time/TIME-OF-DAY-FRACTION-ENCODING.mjs +0 -4
  31. package/dist/types/time/YEAR-ENCODING.mjs +0 -1
  32. package/dist/types/time/YEAR-MONTH-ENCODING.mjs +0 -2
  33. package/dist/utils/bigint.mjs +2 -2
  34. package/dist/utils/dissectFloat.mjs +3 -3
  35. package/dist/utils/encodeX690BinaryRealNumber.mjs +3 -3
  36. package/package.json +1 -1
package/README.md CHANGED
@@ -4,8 +4,11 @@ Feature-complete, specification-compliant TypeScript library for encoding and
4
4
  decoding ASN.1 data structures using the Basic Encoding Rules (BER),
5
5
  Canonical Encoding Rules (CER), and Distinguished Encoding Rules (DER).
6
6
 
7
- Install via `npm install asn1-ts`. As of version 9.0.0 and above, this library
8
- is ESM only: no more CommonJS.
7
+ This library is published on both
8
+ [npmjs.com](https://www.npmjs.com/package/asn1-ts) and on
9
+ [jsr.io](https://jsr.io/@wildboar/asn1). You can install it via
10
+ `npm install asn1-ts` or `npx jsr add @wildboar/asn1`. As of version 9.0.0 and
11
+ above, this library is ESM only: no more CommonJS.
9
12
 
10
13
  **Table of Contents**
11
14
 
@@ -294,8 +297,8 @@ NodeJS.
294
297
  ## See Also
295
298
 
296
299
  - [Libraries that use `asn1-ts`](https://github.com/Wildboar-Software/asn1-typescript-libraries)
297
- - [Meerkat DSA](https://wildboar-software.github.io/directory/), an application
298
- that uses `asn1-ts`.
300
+ - [Meerkat DSA](https://wildboar-software.github.io/directory/), an X.500
301
+ directory server that uses `asn1-ts`.
299
302
  * [X.680 - Abstract Syntax Notation One (ASN.1)](https://www.itu.int/rec/T-REC-X.680/en)
300
303
  * [X.690 - BER, CER, and DER](https://www.itu.int/rec/T-REC-X.690/en)
301
304
  * [ASN.1: Communication Between Heterogeneous Systems](https://www.oss.com/asn1/resources/books-whitepapers-pubs/dubuisson-asn1-book.PDF) by Olivier Dubuisson
package/dist/asn1.mjs CHANGED
@@ -2,13 +2,14 @@ import * as errors from "./errors.mjs";
2
2
  import { ASN1Construction, ASN1TagClass, ASN1UniversalType } from "./values.mjs";
3
3
  import packBits from "./utils/packBits.mjs";
4
4
  import { Buffer } from "node:buffer";
5
- export default class ASN1Element {
6
- recursionCount = 0;
7
- static nestingRecursionLimit = 5;
8
- name = "";
9
- tagClass = ASN1TagClass.universal;
10
- construction = ASN1Construction.primitive;
11
- _tagNumber = 0;
5
+ class ASN1Element {
6
+ constructor() {
7
+ this.recursionCount = 0;
8
+ this.name = "";
9
+ this.tagClass = ASN1TagClass.universal;
10
+ this.construction = ASN1Construction.primitive;
11
+ this._tagNumber = 0;
12
+ }
12
13
  get tagNumber() {
13
14
  return this._tagNumber;
14
15
  }
@@ -347,3 +348,5 @@ export default class ASN1Element {
347
348
  }
348
349
  }
349
350
  }
351
+ ASN1Element.nestingRecursionLimit = 5;
352
+ export default ASN1Element;
@@ -40,10 +40,7 @@ import decodeDuration from "../codecs/ber/decoders/decodeDuration.mjs";
40
40
  import { FALSE_BIT, } from "../macros.mjs";
41
41
  import { isUniquelyTagged } from "../utils/index.mjs";
42
42
  import { Buffer } from "node:buffer";
43
- export default class BERElement extends X690Element {
44
- static lengthEncodingPreference = LengthEncodingPreference.definite;
45
- _value = new Uint8Array(0);
46
- _currentValueLength;
43
+ class BERElement extends X690Element {
47
44
  get value() {
48
45
  if (this._value instanceof Uint8Array) {
49
46
  return this._value;
@@ -442,6 +439,7 @@ export default class BERElement extends X690Element {
442
439
  }
443
440
  constructor(tagClass = ASN1TagClass.universal, construction = ASN1Construction.primitive, tagNumber = ASN1UniversalType.endOfContent, value = undefined) {
444
441
  super();
442
+ this._value = new Uint8Array(0);
445
443
  this.encode(value);
446
444
  this.tagClass = tagClass;
447
445
  this.construction = construction;
@@ -707,3 +705,5 @@ export default class BERElement extends X690Element {
707
705
  return encodedElements;
708
706
  }
709
707
  }
708
+ BERElement.lengthEncodingPreference = LengthEncodingPreference.definite;
709
+ export default BERElement;
@@ -43,8 +43,6 @@ import { FALSE_BIT, } from "../macros.mjs";
43
43
  import { isUniquelyTagged } from "../utils/index.mjs";
44
44
  import { Buffer } from "node:buffer";
45
45
  export default class CERElement extends X690Element {
46
- _value = new Uint8Array(0);
47
- _currentValueLength;
48
46
  get value() {
49
47
  if (this._value instanceof Uint8Array) {
50
48
  return this._value;
@@ -454,6 +452,7 @@ export default class CERElement extends X690Element {
454
452
  }
455
453
  constructor(tagClass = ASN1TagClass.universal, construction = ASN1Construction.primitive, tagNumber = ASN1UniversalType.endOfContent, value = undefined) {
456
454
  super();
455
+ this._value = new Uint8Array(0);
457
456
  this.encode(value);
458
457
  this.tagClass = tagClass;
459
458
  this.construction = construction;
@@ -41,8 +41,6 @@ import X690Element from "../x690.mjs";
41
41
  import { isUniquelyTagged } from "../utils/index.mjs";
42
42
  import { Buffer } from "node:buffer";
43
43
  export default class DERElement extends X690Element {
44
- _value = new Uint8Array(0);
45
- _currentValueLength;
46
44
  get value() {
47
45
  if (this._value instanceof Uint8Array) {
48
46
  return this._value;
@@ -455,6 +453,7 @@ export default class DERElement extends X690Element {
455
453
  }
456
454
  constructor(tagClass = ASN1TagClass.universal, construction = ASN1Construction.primitive, tagNumber = ASN1UniversalType.endOfContent, value = undefined) {
457
455
  super();
456
+ this._value = new Uint8Array(0);
458
457
  this.encode(value);
459
458
  this.tagClass = tagClass;
460
459
  this.construction = construction;
@@ -36,8 +36,8 @@ export default function decodeObjectIdentifier(value) {
36
36
  }
37
37
  }
38
38
  current_node <<= 7;
39
- current_node += (byte & 0b0111_1111);
40
- if ((byte & 0b1000_0000) === 0) {
39
+ current_node += (byte & 127);
40
+ if ((byte & 128) === 0) {
41
41
  nodes.push(current_node);
42
42
  current_node = 0;
43
43
  }
@@ -14,8 +14,8 @@ export default function decodeRelativeObjectIdentifier(value) {
14
14
  throw new errors.ASN1PaddingError("Prohibited padding on RELATIVE-OID node.");
15
15
  }
16
16
  current_node <<= 7;
17
- current_node += (byte & 0b0111_1111);
18
- if ((byte & 0b1000_0000) === 0) {
17
+ current_node += (byte & 127);
18
+ if ((byte & 128) === 0) {
19
19
  nodes.push(current_node);
20
20
  current_node = 0;
21
21
  }
@@ -5,7 +5,7 @@ export default function encodeDate(date) {
5
5
  throw new errors.ASN1Error(`The DATE ${date.toISOString()} may not be encoded, because the `
6
6
  + "year must be greater than 1581 and less than 10000.");
7
7
  }
8
- return convertTextToBytes(date.getFullYear().toString()
8
+ return convertTextToBytes(date.getFullYear().toString().padStart(4, "0")
9
9
  + (date.getMonth() + 1).toString().padStart(2, "0")
10
10
  + date.getDate().toString().padStart(2, "0"));
11
11
  }
@@ -5,7 +5,7 @@ export default function encodeDateTime(value) {
5
5
  throw new errors.ASN1Error(`The DATE ${value.toISOString()} may not be encoded, because the `
6
6
  + "year must be greater than 1581 and less than 10000.");
7
7
  }
8
- return convertTextToBytes(value.getFullYear().toString()
8
+ return convertTextToBytes(value.getFullYear().toString().padStart(4, "0")
9
9
  + (value.getMonth() + 1).toString().padStart(2, "0")
10
10
  + value.getDate().toString().padStart(2, "0")
11
11
  + value.getHours().toString().padStart(2, "0")
@@ -1,6 +1,6 @@
1
1
  import convertTextToBytes from "../../../utils/convertTextToBytes.mjs";
2
2
  export default function encodeGeneralizedTime(value) {
3
- const year = value.getUTCFullYear().toString();
3
+ const year = value.getUTCFullYear().toString().padStart(4, "0");
4
4
  const month = (value.getUTCMonth() + 1).toString().padStart(2, "0");
5
5
  const day = value.getUTCDate().toString().padStart(2, "0");
6
6
  const hour = value.getUTCHours().toString().padStart(2, "0");
@@ -1,4 +1,6 @@
1
1
  import convertTextToBytes from "../../../utils/convertTextToBytes.mjs";
2
2
  export default function encodeTimeOfDay(time) {
3
- return convertTextToBytes(`${time.getHours()}${time.getMinutes()}${time.getSeconds()}`);
3
+ return convertTextToBytes(time.getHours().toString().padStart(2, "0")
4
+ + time.getMinutes().toString().padStart(2, "0")
5
+ + time.getSeconds().toString().padStart(2, "0"));
4
6
  }
@@ -1,7 +1,7 @@
1
1
  import convertTextToBytes from "../../../utils/convertTextToBytes.mjs";
2
2
  export default function encodeUTCTime(value) {
3
3
  let year = value.getUTCFullYear().toString();
4
- year = (year.substring(year.length - 2, year.length));
4
+ year = (year.substring(year.length - 2, year.length)).padStart(2, "0");
5
5
  const month = (value.getUTCMonth() + 1).toString().padStart(2, "0");
6
6
  const day = value.getUTCDate().toString().padStart(2, "0");
7
7
  const hour = value.getUTCHours().toString().padStart(2, "0");
package/dist/errors.mjs CHANGED
@@ -1,6 +1,4 @@
1
1
  export class ASN1Error extends Error {
2
- m;
3
- element;
4
2
  constructor(m, element) {
5
3
  super(m);
6
4
  this.m = m;
@@ -21,8 +19,6 @@ export class ASN1RecursionError extends ASN1Error {
21
19
  }
22
20
  }
23
21
  export class ASN1TruncationError extends ASN1Error {
24
- m;
25
- element;
26
22
  constructor(m, element) {
27
23
  super(m, element);
28
24
  this.m = m;
@@ -31,8 +27,6 @@ export class ASN1TruncationError extends ASN1Error {
31
27
  }
32
28
  }
33
29
  export class ASN1OverflowError extends ASN1Error {
34
- m;
35
- element;
36
30
  constructor(m, element) {
37
31
  super(m, element);
38
32
  this.m = m;
@@ -41,8 +35,6 @@ export class ASN1OverflowError extends ASN1Error {
41
35
  }
42
36
  }
43
37
  export class ASN1SizeError extends ASN1Error {
44
- m;
45
- element;
46
38
  constructor(m, element) {
47
39
  super(m, element);
48
40
  this.m = m;
@@ -51,8 +43,6 @@ export class ASN1SizeError extends ASN1Error {
51
43
  }
52
44
  }
53
45
  export class ASN1PaddingError extends ASN1Error {
54
- m;
55
- element;
56
46
  constructor(m, element) {
57
47
  super(m, element);
58
48
  this.m = m;
@@ -61,8 +51,6 @@ export class ASN1PaddingError extends ASN1Error {
61
51
  }
62
52
  }
63
53
  export class ASN1UndefinedError extends ASN1Error {
64
- m;
65
- element;
66
54
  constructor(m, element) {
67
55
  super(m, element);
68
56
  this.m = m;
@@ -71,8 +59,6 @@ export class ASN1UndefinedError extends ASN1Error {
71
59
  }
72
60
  }
73
61
  export class ASN1CharactersError extends ASN1Error {
74
- m;
75
- element;
76
62
  constructor(m, element) {
77
63
  super(m, element);
78
64
  this.m = m;
@@ -81,8 +67,6 @@ export class ASN1CharactersError extends ASN1Error {
81
67
  }
82
68
  }
83
69
  export class ASN1ConstructionError extends ASN1Error {
84
- m;
85
- element;
86
70
  constructor(m, element) {
87
71
  super(m, element);
88
72
  this.m = m;
@@ -504,11 +504,6 @@ export const _decodeAny = (el) => {
504
504
  return el;
505
505
  };
506
506
  export class ComponentSpec {
507
- name;
508
- optional;
509
- selector;
510
- groupIndex;
511
- versionNumber;
512
507
  constructor(name, optional, selector, groupIndex, versionNumber) {
513
508
  this.name = name;
514
509
  this.optional = optional;
@@ -1,6 +1,4 @@
1
1
  export default class CharacterString {
2
- identification;
3
- stringValue;
4
2
  constructor(identification, stringValue) {
5
3
  this.identification = identification;
6
4
  this.stringValue = stringValue;
@@ -1,6 +1,4 @@
1
1
  export default class EmbeddedPDV {
2
- identification;
3
- dataValue;
4
2
  constructor(identification, dataValue) {
5
3
  this.identification = identification;
6
4
  this.dataValue = dataValue;
@@ -1,9 +1,5 @@
1
1
  import packBits from "../utils/packBits.mjs";
2
2
  export default class External {
3
- directReference;
4
- indirectReference;
5
- dataValueDescriptor;
6
- encoding;
7
3
  constructor(directReference, indirectReference, dataValueDescriptor, encoding) {
8
4
  this.directReference = directReference;
9
5
  this.indirectReference = indirectReference;
@@ -2,7 +2,6 @@ import decodeObjectIdentifier from "../codecs/x690/decoders/decodeObjectIdentifi
2
2
  import encodeObjectIdentifier from "../codecs/x690/encoders/encodeObjectIdentifier.mjs";
3
3
  const PERIOD = ".".charCodeAt(0);
4
4
  export default class ObjectIdentifier {
5
- _nodes;
6
5
  constructor(nodes, prefix) {
7
6
  const _nodes = prefix
8
7
  ? typeof prefix === "number"
@@ -1,6 +1,4 @@
1
1
  export default class TypeIdentifier {
2
- id;
3
- type;
4
2
  constructor(id, type) {
5
3
  this.id = id;
6
4
  this.type = type;
@@ -1,8 +1,5 @@
1
1
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
2
2
  export default class DATE_ENCODING {
3
- year;
4
- month;
5
- day;
6
3
  constructor(year, month, day) {
7
4
  this.year = year;
8
5
  this.month = month;
@@ -1,14 +1,6 @@
1
1
  import * as errors from "../../errors.mjs";
2
2
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
3
3
  export default class DURATION_EQUIVALENT {
4
- years;
5
- months;
6
- weeks;
7
- days;
8
- hours;
9
- minutes;
10
- seconds;
11
- fractional_part;
12
4
  constructor(years, months, weeks, days, hours, minutes, seconds, fractional_part) {
13
5
  this.years = years;
14
6
  this.months = months;
@@ -1,14 +1,6 @@
1
1
  import * as errors from "../../errors.mjs";
2
2
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
3
3
  export default class DURATION_INTERVAL_ENCODING {
4
- years;
5
- months;
6
- weeks;
7
- days;
8
- hours;
9
- minutes;
10
- seconds;
11
- fractional_part;
12
4
  constructor(years, months, weeks, days, hours, minutes, seconds, fractional_part) {
13
5
  this.years = years;
14
6
  this.months = months;
@@ -1,7 +1,5 @@
1
1
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
2
2
  export default class HOURS_DIFF_ENCODING {
3
- hours;
4
- minutes_diff;
5
3
  constructor(hours, minutes_diff) {
6
4
  this.hours = hours;
7
5
  this.minutes_diff = minutes_diff;
@@ -1,6 +1,5 @@
1
1
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
2
2
  export default class HOURS_ENCODING {
3
- hours;
4
3
  constructor(hours) {
5
4
  this.hours = hours;
6
5
  datetimeComponentValidator("hour", 0, 24)("HOURS-ENCODING", hours);
@@ -1,8 +1,5 @@
1
1
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
2
2
  export default class HOURS_MINUTES_DIFF_ENCODING {
3
- hours;
4
- minutes;
5
- minutes_diff;
6
3
  constructor(hours, minutes, minutes_diff) {
7
4
  this.hours = hours;
8
5
  this.minutes = minutes;
@@ -1,7 +1,5 @@
1
1
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
2
2
  export default class HOURS_MINUTES_ENCODING {
3
- hours;
4
- minutes;
5
3
  constructor(hours, minutes) {
6
4
  this.hours = hours;
7
5
  this.minutes = minutes;
@@ -1,9 +1,5 @@
1
1
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
2
2
  export default class TIME_OF_DAY_DIFF_ENCODING {
3
- hours;
4
- minutes;
5
- seconds;
6
- minutes_diff;
7
3
  constructor(hours, minutes, seconds, minutes_diff) {
8
4
  this.hours = hours;
9
5
  this.minutes = minutes;
@@ -1,8 +1,5 @@
1
1
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
2
2
  export default class TIME_OF_DAY_ENCODING {
3
- hours;
4
- minutes;
5
- seconds;
6
3
  constructor(hours, minutes, seconds) {
7
4
  this.hours = hours;
8
5
  this.minutes = minutes;
@@ -1,10 +1,5 @@
1
1
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
2
2
  export default class TIME_OF_DAY_FRACTION_DIFF_ENCODING {
3
- hours;
4
- minutes;
5
- seconds;
6
- fractional_part;
7
- minutes_diff;
8
3
  constructor(hours, minutes, seconds, fractional_part, minutes_diff) {
9
4
  this.hours = hours;
10
5
  this.minutes = minutes;
@@ -1,9 +1,5 @@
1
1
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
2
2
  export default class TIME_OF_DAY_FRACTION_ENCODING {
3
- hours;
4
- minutes;
5
- seconds;
6
- fractional_part;
7
3
  constructor(hours, minutes, seconds, fractional_part) {
8
4
  this.hours = hours;
9
5
  this.minutes = minutes;
@@ -1,5 +1,4 @@
1
1
  export default class YEAR_ENCODING {
2
- year;
3
2
  constructor(year) {
4
3
  this.year = year;
5
4
  }
@@ -1,7 +1,5 @@
1
1
  import datetimeComponentValidator from "../../validators/datetimeComponentValidator.mjs";
2
2
  export default class YEAR_MONTH_ENCODING {
3
- year;
4
- month;
5
3
  constructor(year, month) {
6
4
  this.year = year;
7
5
  this.month = month;
@@ -79,7 +79,7 @@ export function integerToBuffer(int) {
79
79
  else if (int >= 0) {
80
80
  const hex = int.toString(16);
81
81
  ret = Buffer.from(((hex.length % 2) ? `0${hex}` : hex), "hex");
82
- if (ret[0] & 0b1000_0000) {
82
+ if (ret[0] & 128) {
83
83
  ret = Buffer.concat([
84
84
  Buffer.from([0x00]),
85
85
  ret,
@@ -89,7 +89,7 @@ export function integerToBuffer(int) {
89
89
  else {
90
90
  const hex = BigInt.asUintN(100000000, int).toString(16);
91
91
  ret = Buffer.from(((hex.length % 2) ? `0${hex}` : hex), "hex");
92
- if (!(ret[0] & 0b1000_0000)) {
92
+ if (!(ret[0] & 128)) {
93
93
  ret = Buffer.concat([
94
94
  Buffer.from([0xFF]),
95
95
  ret,
@@ -1,10 +1,10 @@
1
- const EXPONENT_BITMASK = 0b0111_1111_1111_0000_0000_0000_0000_0000;
1
+ const EXPONENT_BITMASK = 2146435072;
2
2
  export default function dissectFloat(value) {
3
3
  const float = new Float64Array([value]);
4
4
  const uints = new Uint32Array(float.buffer);
5
5
  const exponent = (((uints[1] & EXPONENT_BITMASK) >>> 20) - 1023 - 31);
6
- const mantissa = 0x8000_0000 + ((((uints[1] & 0x000F_FFFF) << 11)
7
- | ((uints[0] & 0xFFE0_0000) >>> 21)));
6
+ const mantissa = 2147483648 + ((((uints[1] & 1048575) << 11)
7
+ | ((uints[0] & 4292870144) >>> 21)));
8
8
  return {
9
9
  negative: (value < 0),
10
10
  exponent,
@@ -30,9 +30,9 @@ export default function encodeX690BinaryRealNumber(value) {
30
30
  }
31
31
  const singleByteExponent = ((floatComponents.exponent <= 127)
32
32
  && (floatComponents.exponent >= -128));
33
- const firstByte = (0b1000_0000
34
- | (value >= 0 ? 0b0000_0000 : 0b0100_0000)
35
- | (singleByteExponent ? 0b0000_0000 : 0b0000_0001));
33
+ const firstByte = (128
34
+ | (value >= 0 ? 0 : 64)
35
+ | (singleByteExponent ? 0 : 1));
36
36
  const exponentBytes = encodeSignedBigEndianInteger(floatComponents.exponent);
37
37
  const mantissaBytes = encodeUnsignedBigEndianInteger(floatComponents.mantissa);
38
38
  const ret = new Uint8Array(1 + exponentBytes.length + mantissaBytes.length);
package/package.json CHANGED
@@ -48,5 +48,5 @@
48
48
  "test": "node --test"
49
49
  },
50
50
  "types": "./dist/index.d.mts",
51
- "version": "9.0.1"
51
+ "version": "9.0.3"
52
52
  }