@mtkruto/node 0.76.1 → 0.77.0

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 (152) hide show
  1. package/esm/0_deps.d.ts +1 -2
  2. package/esm/0_deps.d.ts.map +1 -1
  3. package/esm/0_deps.js +1 -2
  4. package/esm/0_errors.d.ts +6 -0
  5. package/esm/0_errors.d.ts.map +1 -1
  6. package/esm/0_errors.js +11 -0
  7. package/esm/1_utilities.d.ts +1 -2
  8. package/esm/1_utilities.d.ts.map +1 -1
  9. package/esm/1_utilities.js +1 -2
  10. package/esm/2_tl.d.ts +0 -1
  11. package/esm/2_tl.d.ts.map +1 -1
  12. package/esm/2_tl.js +0 -1
  13. package/esm/client/0_password.d.ts.map +1 -1
  14. package/esm/client/0_password.js +8 -8
  15. package/esm/client/0_storage_operations.d.ts.map +1 -1
  16. package/esm/client/0_storage_operations.js +2 -2
  17. package/esm/client/1_client_plain.js +14 -14
  18. package/{script/deps/jsr.io/@std/assert/1.0.12 → esm/deps/jsr.io/@std/assert/1.0.16}/is_error.d.ts.map +1 -1
  19. package/esm/deps/jsr.io/@std/assert/{1.0.12 → 1.0.16}/not_equals.d.ts.map +1 -1
  20. package/esm/deps/jsr.io/@std/assert/{1.0.12 → 1.0.16}/throws.d.ts.map +1 -1
  21. package/esm/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.d.ts.map +1 -1
  22. package/esm/session/2_session_encrypted.d.ts.map +1 -1
  23. package/esm/session/2_session_encrypted.js +6 -5
  24. package/esm/session/2_session_plain.js +2 -2
  25. package/esm/tl/0_utilities.d.ts +1 -0
  26. package/esm/tl/0_utilities.d.ts.map +1 -1
  27. package/esm/tl/0_utilities.js +3 -0
  28. package/esm/tl/1_tl_reader.d.ts +6 -8
  29. package/esm/tl/1_tl_reader.d.ts.map +1 -1
  30. package/esm/tl/1_tl_reader.js +39 -30
  31. package/esm/tl/1_tl_writer.d.ts +5 -5
  32. package/esm/tl/1_tl_writer.d.ts.map +1 -1
  33. package/esm/tl/1_tl_writer.js +49 -35
  34. package/esm/transport/0_obfuscation.d.ts.map +1 -1
  35. package/esm/transport/0_obfuscation.js +2 -2
  36. package/esm/transport/1_transport_abridged.js +3 -3
  37. package/esm/transport/1_transport_intermediate.js +2 -2
  38. package/esm/types/0_link_preview_media_size.d.ts +19 -0
  39. package/esm/types/0_link_preview_media_size.d.ts.map +1 -1
  40. package/esm/types/0_link_preview_media_size.js +19 -0
  41. package/esm/types/7_saved_chat.d.ts.map +1 -1
  42. package/esm/types/7_saved_chat.js +1 -1
  43. package/esm/utilities/0_int.d.ts +52 -0
  44. package/esm/utilities/0_int.d.ts.map +1 -0
  45. package/esm/utilities/0_int.js +141 -0
  46. package/esm/utilities/0_int_test.d.ts.map +1 -0
  47. package/esm/utilities/1_auth.d.ts.map +1 -1
  48. package/esm/utilities/1_auth.js +3 -4
  49. package/esm/utilities/1_base64.js +1 -1
  50. package/esm/utilities/1_crypto.d.ts.map +1 -1
  51. package/esm/utilities/1_crypto.js +2 -3
  52. package/esm/utilities/1_math.js +1 -1
  53. package/package.json +1 -1
  54. package/script/0_deps.d.ts +1 -2
  55. package/script/0_deps.d.ts.map +1 -1
  56. package/script/0_deps.js +2 -4
  57. package/script/0_errors.d.ts +6 -0
  58. package/script/0_errors.d.ts.map +1 -1
  59. package/script/0_errors.js +13 -1
  60. package/script/1_utilities.d.ts +1 -2
  61. package/script/1_utilities.d.ts.map +1 -1
  62. package/script/1_utilities.js +1 -2
  63. package/script/2_tl.d.ts +0 -1
  64. package/script/2_tl.d.ts.map +1 -1
  65. package/script/2_tl.js +1 -3
  66. package/script/client/0_password.d.ts.map +1 -1
  67. package/script/client/0_password.js +7 -7
  68. package/script/client/0_storage_operations.d.ts.map +1 -1
  69. package/script/client/0_storage_operations.js +1 -1
  70. package/script/client/1_client_plain.js +13 -13
  71. package/{esm/deps/jsr.io/@std/assert/1.0.12 → script/deps/jsr.io/@std/assert/1.0.16}/is_error.d.ts.map +1 -1
  72. package/script/deps/jsr.io/@std/assert/{1.0.12 → 1.0.16}/not_equals.d.ts.map +1 -1
  73. package/script/deps/jsr.io/@std/assert/{1.0.12 → 1.0.16}/throws.d.ts.map +1 -1
  74. package/script/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.d.ts.map +1 -1
  75. package/script/session/2_session_encrypted.d.ts.map +1 -1
  76. package/script/session/2_session_encrypted.js +5 -4
  77. package/script/session/2_session_plain.js +1 -1
  78. package/script/tl/0_utilities.d.ts +1 -0
  79. package/script/tl/0_utilities.d.ts.map +1 -1
  80. package/script/tl/0_utilities.js +4 -0
  81. package/script/tl/1_tl_reader.d.ts +6 -8
  82. package/script/tl/1_tl_reader.d.ts.map +1 -1
  83. package/script/tl/1_tl_reader.js +38 -30
  84. package/script/tl/1_tl_writer.d.ts +5 -5
  85. package/script/tl/1_tl_writer.d.ts.map +1 -1
  86. package/script/tl/1_tl_writer.js +49 -35
  87. package/script/transport/0_obfuscation.d.ts.map +1 -1
  88. package/script/transport/0_obfuscation.js +1 -1
  89. package/script/transport/1_transport_abridged.js +2 -2
  90. package/script/transport/1_transport_intermediate.js +1 -1
  91. package/script/types/0_link_preview_media_size.d.ts +19 -0
  92. package/script/types/0_link_preview_media_size.d.ts.map +1 -1
  93. package/script/types/0_link_preview_media_size.js +19 -0
  94. package/script/types/7_saved_chat.d.ts.map +1 -1
  95. package/script/types/7_saved_chat.js +3 -3
  96. package/script/utilities/0_int.d.ts +52 -0
  97. package/script/utilities/0_int.d.ts.map +1 -0
  98. package/script/utilities/{0_bigint.js → 0_int.js} +66 -15
  99. package/script/utilities/0_int_test.d.ts.map +1 -0
  100. package/script/utilities/1_auth.d.ts.map +1 -1
  101. package/script/utilities/1_auth.js +4 -5
  102. package/script/utilities/1_base64.js +2 -2
  103. package/script/utilities/1_crypto.d.ts.map +1 -1
  104. package/script/utilities/1_crypto.js +2 -3
  105. package/script/utilities/1_math.js +4 -4
  106. package/esm/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts.map +0 -1
  107. package/esm/deps/jsr.io/@std/assert/1.0.12/equal.d.ts.map +0 -1
  108. package/esm/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts.map +0 -1
  109. package/esm/deps/jsr.io/@std/assert/1.0.13/assertion_error.d.ts +0 -26
  110. package/esm/deps/jsr.io/@std/assert/1.0.13/assertion_error.d.ts.map +0 -1
  111. package/esm/deps/jsr.io/@std/assert/1.0.13/assertion_error.js +0 -30
  112. package/esm/deps/jsr.io/@std/assert/1.0.13/unreachable.d.ts +0 -15
  113. package/esm/deps/jsr.io/@std/assert/1.0.13/unreachable.d.ts.map +0 -1
  114. package/esm/deps/jsr.io/@std/assert/1.0.13/unreachable.js +0 -20
  115. package/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts +0 -23
  116. package/esm/deps/jsr.io/@std/assert/1.0.16/instance_of.js +0 -52
  117. package/esm/tl/0_tl_error.d.ts +0 -23
  118. package/esm/tl/0_tl_error.d.ts.map +0 -1
  119. package/esm/tl/0_tl_error.js +0 -22
  120. package/esm/utilities/0_bigint.d.ts +0 -10
  121. package/esm/utilities/0_bigint.d.ts.map +0 -1
  122. package/esm/utilities/0_bigint.js +0 -91
  123. package/esm/utilities/0_bigint_test.d.ts.map +0 -1
  124. package/esm/utilities/0_buffer.d.ts +0 -21
  125. package/esm/utilities/0_buffer.d.ts.map +0 -1
  126. package/esm/utilities/0_buffer.js +0 -51
  127. package/esm/utilities/0_buffer_test.d.ts.map +0 -1
  128. package/script/deps/jsr.io/@std/assert/1.0.12/assertion_error.d.ts.map +0 -1
  129. package/script/deps/jsr.io/@std/assert/1.0.12/equal.d.ts.map +0 -1
  130. package/script/deps/jsr.io/@std/assert/1.0.12/instance_of.d.ts.map +0 -1
  131. package/script/deps/jsr.io/@std/assert/1.0.13/assertion_error.d.ts +0 -26
  132. package/script/deps/jsr.io/@std/assert/1.0.13/assertion_error.d.ts.map +0 -1
  133. package/script/deps/jsr.io/@std/assert/1.0.13/assertion_error.js +0 -34
  134. package/script/deps/jsr.io/@std/assert/1.0.13/unreachable.d.ts +0 -15
  135. package/script/deps/jsr.io/@std/assert/1.0.13/unreachable.d.ts.map +0 -1
  136. package/script/deps/jsr.io/@std/assert/1.0.13/unreachable.js +0 -23
  137. package/script/deps/jsr.io/@std/assert/1.0.16/instance_of.d.ts +0 -23
  138. package/script/deps/jsr.io/@std/assert/1.0.16/instance_of.js +0 -55
  139. package/script/tl/0_tl_error.d.ts +0 -23
  140. package/script/tl/0_tl_error.d.ts.map +0 -1
  141. package/script/tl/0_tl_error.js +0 -26
  142. package/script/utilities/0_bigint.d.ts +0 -10
  143. package/script/utilities/0_bigint.d.ts.map +0 -1
  144. package/script/utilities/0_bigint_test.d.ts.map +0 -1
  145. package/script/utilities/0_buffer.d.ts +0 -21
  146. package/script/utilities/0_buffer.d.ts.map +0 -1
  147. package/script/utilities/0_buffer.js +0 -54
  148. package/script/utilities/0_buffer_test.d.ts.map +0 -1
  149. /package/esm/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.d.ts +0 -0
  150. /package/esm/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.js +0 -0
  151. /package/script/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.d.ts +0 -0
  152. /package/script/deps/jsr.io/@std/streams/{1.0.12 → 1.0.14}/to_array_buffer.js +0 -0
@@ -0,0 +1,52 @@
1
+ export type ByteOrder = "little" | "big";
2
+ export declare function modExp(a: bigint, b: bigint, n: bigint): bigint;
3
+ export declare function mod(n: bigint, m: bigint): bigint;
4
+ export declare function mod(n: number, m: number): number;
5
+ /**
6
+ * Additional parameters for { @link intFromBytes }.
7
+ */
8
+ export interface IntFromBytesParams {
9
+ /** The byte order of the representation. Defaults to `little`. */
10
+ byteOrder?: ByteOrder;
11
+ /** Whether the integer is a signed one. Defaults to `true`. */
12
+ isSigned?: boolean;
13
+ }
14
+ /**
15
+ * Creates an integer from its byte representation.
16
+ *
17
+ * @param bytes The byte representation of the integer.
18
+ * @param params Additional parameters.
19
+ */
20
+ export declare function intFromBytes(bytes: Uint8Array, { byteOrder, isSigned }?: IntFromBytesParams): bigint;
21
+ /**
22
+ * Generates a random integer of an arbitrary size.
23
+ *
24
+ * @param isSigned Whether to allow signed integers. Defaults to `true`.
25
+ */
26
+ export declare function getRandomInt(byteLength: number, isSigned?: boolean): bigint;
27
+ /**
28
+ * Generates a random ID. Useful when interacting with the Telegram API.
29
+ *
30
+ * @param isNumber Whether the ID should be of the type number instead of a bigint.
31
+ */
32
+ export declare function getRandomId(isNumber: true): number;
33
+ export declare function getRandomId(): bigint;
34
+ export declare function gcd(a: bigint, b: bigint): bigint;
35
+ /** Additional parameters for { @link intToBuffer }. */
36
+ export interface BufferFromBigintParams {
37
+ /** The byte order to use for the representation. Defaults to `little`. */
38
+ byteOrder?: ByteOrder;
39
+ /** Whether the integer is a signed one. Defaults to `true`. */
40
+ isSigned?: boolean;
41
+ /** The path to the integer in the TL schema. Unspecified by default. */
42
+ path?: string[];
43
+ }
44
+ /**
45
+ * Converts an integer to its byte representation.
46
+ *
47
+ * @param int The integer to convert.
48
+ * @param byteCount The expected size of the integer in bytes.
49
+ * @param params Additional parameters.
50
+ */
51
+ export declare function intToBytes(int: bigint | number, byteCount: number, { byteOrder, isSigned, path, }?: BufferFromBigintParams): Uint8Array<ArrayBuffer>;
52
+ //# sourceMappingURL=0_int.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_int.d.ts","sourceRoot":"","sources":["../../src/utilities/0_int.ts"],"names":[],"mappings":"AAwBA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEzC,wBAAgB,MAAM,CACpB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,UAgBV;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;AAClD,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;AAOlD;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,kEAAkE;IAClE,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,SAAoB,EAAE,QAAe,EAAE,GAAE,kBAAuB,UAcjH;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,UAAO,UAI/D;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,IAAI,GAAG,MAAM,CAAC;AACpD,wBAAgB,WAAW,IAAI,MAAM,CAAC;AAStC,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAwBvC;AAID,uDAAuD;AACvD,MAAM,WAAW,sBAAsB;IACrC,0EAA0E;IAC1E,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wEAAwE;IACxE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,EAClE,SAAoB,EACpB,QAAe,EACf,IAAS,GACV,GAAE,sBAA2B,GAAG,UAAU,CAAC,WAAW,CAAC,CAoCvD"}
@@ -35,10 +35,11 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.modExp = modExp;
37
37
  exports.mod = mod;
38
- exports.bigIntFromBuffer = bigIntFromBuffer;
39
- exports.getRandomBigInt = getRandomBigInt;
38
+ exports.intFromBytes = intFromBytes;
39
+ exports.getRandomInt = getRandomInt;
40
40
  exports.getRandomId = getRandomId;
41
41
  exports.gcd = gcd;
42
+ exports.intToBytes = intToBytes;
42
43
  /**
43
44
  * MTKruto - Cross-runtime JavaScript library for building Telegram clients
44
45
  * Copyright (C) 2023-2025 Roj <https://roj.im/>
@@ -59,6 +60,7 @@ exports.gcd = gcd;
59
60
  * along with this program. If not, see <https://www.gnu.org/licenses/>.
60
61
  */
61
62
  const dntShim = __importStar(require("../_dnt.shims.js"));
63
+ const _0_errors_js_1 = require("../0_errors.js");
62
64
  function modExp(a, b, n) {
63
65
  a %= n;
64
66
  let result = 1n;
@@ -80,29 +82,39 @@ function mod(n, m) {
80
82
  // @ts-ignore
81
83
  return ((n % m) + m) % m;
82
84
  }
83
- function bigIntFromBuffer(buffer, little = true, signed = false) {
84
- let randomBuffer = buffer;
85
- const bytesLength = randomBuffer.length;
86
- if (little) {
87
- randomBuffer = randomBuffer.reverse();
85
+ /**
86
+ * Creates an integer from its byte representation.
87
+ *
88
+ * @param bytes The byte representation of the integer.
89
+ * @param params Additional parameters.
90
+ */
91
+ function intFromBytes(bytes, { byteOrder = "little", isSigned = true } = {}) {
92
+ const bytesLength = bytes.length;
93
+ if (byteOrder === "little") {
94
+ bytes = bytes.toReversed();
88
95
  }
89
- let bigIntVar = BigInt("0x" + [...randomBuffer].map((v) => v.toString(16).padStart(2, "0")).join(""));
90
- if (signed && Math.floor(bigIntVar.toString(2).length / 8) >= bytesLength) {
96
+ let bigIntVar = BigInt("0x" + [...bytes].map((v) => v.toString(16).padStart(2, "0")).join(""));
97
+ if (isSigned && Math.floor(bigIntVar.toString(2).length / 8) >= bytesLength) {
91
98
  bigIntVar = bigIntVar - (2n ** (BigInt(bytesLength * 8)));
92
99
  }
93
100
  return bigIntVar;
94
101
  }
95
- function getRandomBigInt(byteLength, little, signed) {
102
+ /**
103
+ * Generates a random integer of an arbitrary size.
104
+ *
105
+ * @param isSigned Whether to allow signed integers. Defaults to `true`.
106
+ */
107
+ function getRandomInt(byteLength, isSigned = true) {
96
108
  const randomBytes = new Uint8Array(byteLength);
97
109
  dntShim.crypto.getRandomValues(randomBytes);
98
- return bigIntFromBuffer(randomBytes, little, signed);
110
+ return intFromBytes(randomBytes, { isSigned });
99
111
  }
100
- function getRandomId(number) {
101
- if (number) {
102
- return Number(getRandomBigInt(4, true, true));
112
+ function getRandomId(isNumber) {
113
+ if (isNumber) {
114
+ return Number(getRandomInt(4, true));
103
115
  }
104
116
  else {
105
- return getRandomBigInt(8, true, true);
117
+ return getRandomInt(8, true);
106
118
  }
107
119
  }
108
120
  function gcd(a, b) {
@@ -130,3 +142,42 @@ function gcd(a, b) {
130
142
  }
131
143
  }
132
144
  }
145
+ const bufferFromHexString = (hexString) => Uint8Array.from(hexString.match(/.{1,2}/g).map((byte) => parseInt(byte, 16)));
146
+ /**
147
+ * Converts an integer to its byte representation.
148
+ *
149
+ * @param int The integer to convert.
150
+ * @param byteCount The expected size of the integer in bytes.
151
+ * @param params Additional parameters.
152
+ */
153
+ function intToBytes(int, byteCount, { byteOrder = "little", isSigned = true, path = [], } = {}) {
154
+ const actualByteCount = Math.ceil(int.toString(2).length / 8);
155
+ if (byteCount < actualByteCount) {
156
+ throw new _0_errors_js_1.TLError(`The provided integer is too big for int${byteCount * 8}`, path);
157
+ }
158
+ if (byteCount === 4 || byteCount === 2) { // fast path
159
+ const buffer = new Uint8Array(byteCount);
160
+ const dataView = new DataView(buffer.buffer);
161
+ (byteCount === 2 ? isSigned ? dataView.setInt16 : dataView.setUint16 : isSigned ? dataView.setInt32 : dataView.setUint32).call(dataView, 0, Number(int), byteOrder === "little");
162
+ return buffer;
163
+ }
164
+ int = BigInt(typeof int === "number" ? Math.ceil(int) : int);
165
+ if (byteCount === 8) { // fast path
166
+ const buffer = new Uint8Array(byteCount);
167
+ const dataView = new DataView(buffer.buffer);
168
+ (isSigned ? dataView.setBigInt64 : dataView.setBigUint64).call(dataView, 0, int, byteOrder === "little");
169
+ return buffer;
170
+ }
171
+ if (!isSigned && int < 0n) {
172
+ throw new _0_errors_js_1.TLError("Received a signed integer while an unsigned one was expected", path);
173
+ }
174
+ if (isSigned && int < 0n) {
175
+ int = 2n ** BigInt(byteCount * 8) + int;
176
+ }
177
+ const hex = int.toString(16).padStart(byteCount * 2, "0");
178
+ const buffer = bufferFromHexString(hex);
179
+ if (byteOrder === "little") {
180
+ buffer.reverse();
181
+ }
182
+ return buffer;
183
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"0_int_test.d.ts","sourceRoot":"","sources":["../../src/utilities/0_int_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,2BAA2B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"1_auth.d.ts","sourceRoot":"","sources":["../../src/utilities/1_auth.ts"],"names":[],"mappings":"AA2BA,wBAAsB,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,oCAiCrF"}
1
+ {"version":3,"file":"1_auth.d.ts","sourceRoot":"","sources":["../../src/utilities/1_auth.ts"],"names":[],"mappings":"AA0BA,wBAAsB,MAAM,CAAC,IAAI,EAAE,UAAU,EAAE,CAAC,SAAS,EAAE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,oCAiCrF"}
@@ -55,9 +55,8 @@ exports.rsaPad = rsaPad;
55
55
  */
56
56
  const dntShim = __importStar(require("../_dnt.shims.js"));
57
57
  const _0_deps_js_1 = require("../0_deps.js");
58
- const _0_bigint_js_1 = require("./0_bigint.js");
59
- const _0_buffer_js_1 = require("./0_buffer.js");
60
58
  const _0_hash_js_1 = require("./0_hash.js");
59
+ const _0_int_js_1 = require("./0_int.js");
61
60
  async function rsaPad(data, [serverKey, exponent]) {
62
61
  (0, _0_deps_js_1.assert)(data.length <= 144);
63
62
  let keyAesEncryptedInt;
@@ -75,10 +74,10 @@ async function rsaPad(data, [serverKey, exponent]) {
75
74
  const tempKeyXor = tempKey.map((v, i) => v ^ aesEncryptedSha256[i]);
76
75
  const keyAesEncrypted = (0, _0_deps_js_1.concat)([tempKeyXor, aesEncrypted]);
77
76
  (0, _0_deps_js_1.assertEquals)(keyAesEncrypted.length, 256);
78
- keyAesEncryptedInt = (0, _0_bigint_js_1.bigIntFromBuffer)(keyAesEncrypted, false, false);
77
+ keyAesEncryptedInt = (0, _0_int_js_1.intFromBytes)(keyAesEncrypted, { byteOrder: "big", isSigned: false });
79
78
  } while (keyAesEncryptedInt >= serverKey);
80
- const encryptedDataInt = (0, _0_bigint_js_1.modExp)(keyAesEncryptedInt, exponent, serverKey);
81
- const encryptedData = (0, _0_buffer_js_1.bufferFromBigInt)(encryptedDataInt, 256, false, false);
79
+ const encryptedDataInt = (0, _0_int_js_1.modExp)(keyAesEncryptedInt, exponent, serverKey);
80
+ const encryptedData = (0, _0_int_js_1.intToBytes)(encryptedDataInt, 256, { byteOrder: "big", isSigned: false });
82
81
  (0, _0_deps_js_1.assertEquals)(encryptedData.length, 256);
83
82
  return encryptedData;
84
83
  }
@@ -22,14 +22,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.base64EncodeUrlSafe = base64EncodeUrlSafe;
23
23
  exports.base64DecodeUrlSafe = base64DecodeUrlSafe;
24
24
  const _0_deps_js_1 = require("../0_deps.js");
25
- const _0_bigint_js_1 = require("./0_bigint.js");
25
+ const _0_int_js_1 = require("./0_int.js");
26
26
  function base64EncodeUrlSafe(data) {
27
27
  return (0, _0_deps_js_1.encodeBase64)(data).replace(/=*$/, "").replaceAll("+", "-").replaceAll("/", "_");
28
28
  }
29
29
  function base64DecodeUrlSafe(data) {
30
30
  data = data.replaceAll("_", "/").replaceAll("-", "+");
31
31
  if (data.length !== 4) {
32
- data += "=".repeat((0, _0_bigint_js_1.mod)(-data.length, 4));
32
+ data += "=".repeat((0, _0_int_js_1.mod)(-data.length, 4));
33
33
  }
34
34
  return (0, _0_deps_js_1.decodeBase64)(data);
35
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"1_crypto.d.ts","sourceRoot":"","sources":["../../src/utilities/1_crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAO5C,qBAAa,GAAG;;IAMd,IAAI,MAAM,IAAI;QAAE,EAAE,EAAE,UAAU,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAE9C;gBAEW,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,EAAE,UAAU;WAKrC,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IAI1E,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;CAkD5E"}
1
+ {"version":3,"file":"1_crypto.d.ts","sourceRoot":"","sources":["../../src/utilities/1_crypto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAM5C,qBAAa,GAAG;;IAMd,IAAI,MAAM,IAAI;QAAE,EAAE,EAAE,UAAU,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAE9C;gBAEW,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE,EAAE,EAAE,UAAU;WAKrC,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC;IAI1E,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;CAkD5E"}
@@ -55,8 +55,7 @@ exports.CTR = void 0;
55
55
  */
56
56
  const dntShim = __importStar(require("../_dnt.shims.js"));
57
57
  const _0_deps_js_1 = require("../0_deps.js");
58
- const _0_bigint_js_1 = require("./0_bigint.js");
59
- const _0_buffer_js_1 = require("./0_buffer.js");
58
+ const _0_int_js_1 = require("./0_int.js");
60
59
  class CTR {
61
60
  #key;
62
61
  #iv;
@@ -112,7 +111,7 @@ class CTR {
112
111
  if (amount < 1) {
113
112
  return;
114
113
  }
115
- this.#iv = (0, _0_buffer_js_1.bufferFromBigInt)((0, _0_bigint_js_1.bigIntFromBuffer)(this.#iv, false, false) + BigInt(amount), this.#iv.length, false, false);
114
+ this.#iv = (0, _0_int_js_1.intToBytes)((0, _0_int_js_1.intFromBytes)(this.#iv, { byteOrder: "big", isSigned: false }) + BigInt(amount), this.#iv.length, { byteOrder: "big", isSigned: false });
116
115
  }
117
116
  }
118
117
  exports.CTR = CTR;
@@ -21,7 +21,7 @@
21
21
  Object.defineProperty(exports, "__esModule", { value: true });
22
22
  exports.factorize = factorize;
23
23
  const _0_deps_js_1 = require("../0_deps.js");
24
- const _0_bigint_js_1 = require("./0_bigint.js");
24
+ const _0_int_js_1 = require("./0_int.js");
25
25
  function getRandomNumberInRange(min, max) {
26
26
  return Math.floor(Math.random() * (max - min) + min);
27
27
  }
@@ -34,12 +34,12 @@ function factorize(pq) {
34
34
  let found = false;
35
35
  for (let i = 0, iter = 0; !found && (i < 3 || iter < 1000); i++) {
36
36
  const t = BigInt(getRandomNumberInRange(17, 32)) % (pq - 1n);
37
- a = (0, _0_bigint_js_1.getRandomId)();
37
+ a = (0, _0_int_js_1.getRandomId)();
38
38
  b = a;
39
39
  const lim = 1 << (i + 23);
40
40
  for (let j = 1; j < lim; j++) {
41
41
  iter++;
42
- a = (0, _0_bigint_js_1.mod)(a * a, pq);
42
+ a = (0, _0_int_js_1.mod)(a * a, pq);
43
43
  a += t;
44
44
  if (a >= pq) {
45
45
  a = a - pq;
@@ -50,7 +50,7 @@ function factorize(pq) {
50
50
  else {
51
51
  q = b - a;
52
52
  }
53
- p = (0, _0_bigint_js_1.gcd)(q, pq);
53
+ p = (0, _0_int_js_1.gcd)(q, pq);
54
54
  if (p !== one) {
55
55
  found = true;
56
56
  break;
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertion_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/assertion_error.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"equal.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/equal.ts"],"names":[],"mappings":"AA2FA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,GAAG,OAAO,CAuGrD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"instance_of.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.12/instance_of.ts"],"names":[],"mappings":"AAIA,sBAAsB;AAEtB,MAAM,MAAM,cAAc,GAAG,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,CAAC;AACzD,4BAA4B;AAC5B,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,cAAc,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAE9B,CAAC,SAAS,QAAQ,MAAM,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,EAE9C,MAAM,EAAE,OAAO,EACf,YAAY,EAAE,CAAC,EACf,GAAG,SAAK,GACP,OAAO,CAAC,MAAM,IAAI,YAAY,CAAC,CAAC,CAAC,CA6BnC"}
@@ -1,26 +0,0 @@
1
- /**
2
- * Error thrown when an assertion fails.
3
- *
4
- * @example Usage
5
- * ```ts ignore
6
- * import { AssertionError } from "@std/assert";
7
- *
8
- * try {
9
- * throw new AssertionError("foo", { cause: "bar" });
10
- * } catch (error) {
11
- * if (error instanceof AssertionError) {
12
- * error.message === "foo"; // true
13
- * error.cause === "bar"; // true
14
- * }
15
- * }
16
- * ```
17
- */
18
- export declare class AssertionError extends Error {
19
- /** Constructs a new instance.
20
- *
21
- * @param message The error message.
22
- * @param options Additional options. This argument is still unstable. It may change in the future release.
23
- */
24
- constructor(message: string, options?: ErrorOptions);
25
- }
26
- //# sourceMappingURL=assertion_error.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assertion_error.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.13/assertion_error.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC;;;;OAIG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY;CAIpD"}
@@ -1,30 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- // This module is browser compatible.
3
- /**
4
- * Error thrown when an assertion fails.
5
- *
6
- * @example Usage
7
- * ```ts ignore
8
- * import { AssertionError } from "@std/assert";
9
- *
10
- * try {
11
- * throw new AssertionError("foo", { cause: "bar" });
12
- * } catch (error) {
13
- * if (error instanceof AssertionError) {
14
- * error.message === "foo"; // true
15
- * error.cause === "bar"; // true
16
- * }
17
- * }
18
- * ```
19
- */
20
- export class AssertionError extends Error {
21
- /** Constructs a new instance.
22
- *
23
- * @param message The error message.
24
- * @param options Additional options. This argument is still unstable. It may change in the future release.
25
- */
26
- constructor(message, options) {
27
- super(message, options);
28
- this.name = "AssertionError";
29
- }
30
- }
@@ -1,15 +0,0 @@
1
- /**
2
- * Use this to assert unreachable code.
3
- *
4
- * @example Usage
5
- * ```ts ignore
6
- * import { unreachable } from "@std/assert";
7
- *
8
- * unreachable(); // Throws
9
- * ```
10
- *
11
- * @param msg Optional message to include in the error.
12
- * @returns Never returns, always throws.
13
- */
14
- export declare function unreachable(msg?: string): never;
15
- //# sourceMappingURL=unreachable.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unreachable.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/assert/1.0.13/unreachable.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,GAAG,CAAC,EAAE,MAAM,GAAG,KAAK,CAG/C"}
@@ -1,20 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- // This module is browser compatible.
3
- import { AssertionError } from "./assertion_error.js";
4
- /**
5
- * Use this to assert unreachable code.
6
- *
7
- * @example Usage
8
- * ```ts ignore
9
- * import { unreachable } from "@std/assert";
10
- *
11
- * unreachable(); // Throws
12
- * ```
13
- *
14
- * @param msg Optional message to include in the error.
15
- * @returns Never returns, always throws.
16
- */
17
- export function unreachable(msg) {
18
- const msgSuffix = msg ? `: ${msg}` : ".";
19
- throw new AssertionError(`Unreachable${msgSuffix}`);
20
- }
@@ -1,23 +0,0 @@
1
- /** Any constructor */
2
- export type AnyConstructor = new (...args: any[]) => any;
3
- /** Gets constructor type */
4
- export type GetConstructorType<T extends AnyConstructor> = InstanceType<T>;
5
- /**
6
- * Make an assertion that `obj` is an instance of `type`.
7
- * If not then throw.
8
- *
9
- * @example Usage
10
- * ```ts ignore
11
- * import { assertInstanceOf } from "@std/assert";
12
- *
13
- * assertInstanceOf(new Date(), Date); // Doesn't throw
14
- * assertInstanceOf(new Date(), Number); // Throws
15
- * ```
16
- *
17
- * @typeParam T The expected type of the object.
18
- * @param actual The object to check.
19
- * @param expectedType The expected class constructor.
20
- * @param msg The optional message to display if the assertion fails.
21
- */
22
- export declare function assertInstanceOf<T extends abstract new (...args: any[]) => any>(actual: unknown, expectedType: T, msg?: string): asserts actual is InstanceType<T>;
23
- //# sourceMappingURL=instance_of.d.ts.map
@@ -1,52 +0,0 @@
1
- // Copyright 2018-2025 the Deno authors. MIT license.
2
- // This module is browser compatible.
3
- import { AssertionError } from "./assertion_error.js";
4
- /**
5
- * Make an assertion that `obj` is an instance of `type`.
6
- * If not then throw.
7
- *
8
- * @example Usage
9
- * ```ts ignore
10
- * import { assertInstanceOf } from "@std/assert";
11
- *
12
- * assertInstanceOf(new Date(), Date); // Doesn't throw
13
- * assertInstanceOf(new Date(), Number); // Throws
14
- * ```
15
- *
16
- * @typeParam T The expected type of the object.
17
- * @param actual The object to check.
18
- * @param expectedType The expected class constructor.
19
- * @param msg The optional message to display if the assertion fails.
20
- */
21
- export function assertInstanceOf(actual, expectedType, msg = "") {
22
- if (actual instanceof expectedType)
23
- return;
24
- const msgSuffix = msg ? `: ${msg}` : ".";
25
- const expectedTypeStr = expectedType.name;
26
- let actualTypeStr = "";
27
- if (actual === null) {
28
- actualTypeStr = "null";
29
- }
30
- else if (actual === undefined) {
31
- actualTypeStr = "undefined";
32
- }
33
- else if (typeof actual === "object") {
34
- actualTypeStr = actual.constructor?.name ?? "Object";
35
- }
36
- else {
37
- actualTypeStr = typeof actual;
38
- }
39
- if (expectedTypeStr === actualTypeStr) {
40
- msg =
41
- `Expected object to be an instance of "${expectedTypeStr}"${msgSuffix}`;
42
- }
43
- else if (actualTypeStr === "function") {
44
- msg =
45
- `Expected object to be an instance of "${expectedTypeStr}" but was not an instanced object${msgSuffix}`;
46
- }
47
- else {
48
- msg =
49
- `Expected object to be an instance of "${expectedTypeStr}" but was "${actualTypeStr}"${msgSuffix}`;
50
- }
51
- throw new AssertionError(msg);
52
- }
@@ -1,23 +0,0 @@
1
- /**
2
- * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
- * Copyright (C) 2023-2025 Roj <https://roj.im/>
4
- *
5
- * This file is part of MTKruto.
6
- *
7
- * This program is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU Lesser General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU Lesser General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU Lesser General Public License
18
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
- */
20
- export declare class TLError extends Error {
21
- name: string;
22
- }
23
- //# sourceMappingURL=0_tl_error.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"0_tl_error.d.ts","sourceRoot":"","sources":["../../src/tl/0_tl_error.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,qBAAa,OAAQ,SAAQ,KAAK;IACvB,IAAI,SAAa;CAE3B"}
@@ -1,22 +0,0 @@
1
- /**
2
- * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
- * Copyright (C) 2023-2025 Roj <https://roj.im/>
4
- *
5
- * This file is part of MTKruto.
6
- *
7
- * This program is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU Lesser General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU Lesser General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU Lesser General Public License
18
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
- */
20
- export class TLError extends Error {
21
- name = "TLError";
22
- }
@@ -1,10 +0,0 @@
1
- export declare function modExp(a: bigint, b: bigint, n: bigint): bigint;
2
- export declare function mod(n: bigint, m: bigint): bigint;
3
- export declare function mod(n: number, m: number): number;
4
- export declare function bigIntFromBuffer(buffer: Uint8Array, little?: boolean, signed?: boolean): bigint;
5
- export declare function getRandomBigInt(byteLength: number, little?: boolean, signed?: boolean): bigint;
6
- /** Get a random ID. Useful when calling API functions directly. */
7
- export declare function getRandomId(number: true): number;
8
- export declare function getRandomId(): bigint;
9
- export declare function gcd(a: bigint, b: bigint): bigint;
10
- //# sourceMappingURL=0_bigint.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"0_bigint.d.ts","sourceRoot":"","sources":["../../src/utilities/0_bigint.ts"],"names":[],"mappings":"AAsBA,wBAAgB,MAAM,CACpB,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,UAgBV;AAED,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;AAClD,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;AAOlD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,UAAO,EAAE,MAAM,UAAQ,UAejF;AAED,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,OAAO,UAIrF;AAED,mEAAmE;AACnE,wBAAgB,WAAW,CAAC,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;AAClD,wBAAgB,WAAW,IAAI,MAAM,CAAC;AAStC,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,UAwBvC"}
@@ -1,91 +0,0 @@
1
- /**
2
- * MTKruto - Cross-runtime JavaScript library for building Telegram clients
3
- * Copyright (C) 2023-2025 Roj <https://roj.im/>
4
- *
5
- * This file is part of MTKruto.
6
- *
7
- * This program is free software: you can redistribute it and/or modify
8
- * it under the terms of the GNU Lesser General Public License as published by
9
- * the Free Software Foundation, either version 3 of the License, or
10
- * (at your option) any later version.
11
- *
12
- * This program is distributed in the hope that it will be useful,
13
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- * GNU Lesser General Public License for more details.
16
- *
17
- * You should have received a copy of the GNU Lesser General Public License
18
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
19
- */
20
- import * as dntShim from "../_dnt.shims.js";
21
- export function modExp(a, b, n) {
22
- a %= n;
23
- let result = 1n;
24
- let x = a;
25
- while (b > 0n) {
26
- const leastSignificantBit = b % 2n;
27
- b /= 2n;
28
- if (leastSignificantBit === 1n) {
29
- result *= x;
30
- result %= n;
31
- }
32
- x *= x;
33
- x %= n;
34
- }
35
- return result;
36
- }
37
- export function mod(n, m) {
38
- // deno-lint-ignore ban-ts-comment
39
- // @ts-ignore
40
- return ((n % m) + m) % m;
41
- }
42
- export function bigIntFromBuffer(buffer, little = true, signed = false) {
43
- let randomBuffer = buffer;
44
- const bytesLength = randomBuffer.length;
45
- if (little) {
46
- randomBuffer = randomBuffer.reverse();
47
- }
48
- let bigIntVar = BigInt("0x" + [...randomBuffer].map((v) => v.toString(16).padStart(2, "0")).join(""));
49
- if (signed && Math.floor(bigIntVar.toString(2).length / 8) >= bytesLength) {
50
- bigIntVar = bigIntVar - (2n ** (BigInt(bytesLength * 8)));
51
- }
52
- return bigIntVar;
53
- }
54
- export function getRandomBigInt(byteLength, little, signed) {
55
- const randomBytes = new Uint8Array(byteLength);
56
- dntShim.crypto.getRandomValues(randomBytes);
57
- return bigIntFromBuffer(randomBytes, little, signed);
58
- }
59
- export function getRandomId(number) {
60
- if (number) {
61
- return Number(getRandomBigInt(4, true, true));
62
- }
63
- else {
64
- return getRandomBigInt(8, true, true);
65
- }
66
- }
67
- export function gcd(a, b) {
68
- if (a === 0n) {
69
- return b;
70
- }
71
- while ((a & 1n) === 0n) {
72
- a >>= 1n;
73
- }
74
- while (true) {
75
- if (a > b) {
76
- a = (a - b) >> 1n;
77
- while ((a & 1n) === 0n) {
78
- a >>= 1n;
79
- }
80
- }
81
- else if (b > a) {
82
- b = (b - a) >> 1n;
83
- while ((b & 1n) === 0n) {
84
- b >>= 1n;
85
- }
86
- }
87
- else {
88
- return a;
89
- }
90
- }
91
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"0_bigint_test.d.ts","sourceRoot":"","sources":["../../src/utilities/0_bigint_test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,2BAA2B,CAAC"}