nlcurl 0.6.0 → 0.8.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 (354) hide show
  1. package/README.md +143 -140
  2. package/dist/cache/groups.d.ts +75 -0
  3. package/dist/cache/groups.d.ts.map +1 -0
  4. package/dist/cache/groups.js +118 -0
  5. package/dist/cache/groups.js.map +1 -0
  6. package/dist/cache/no-vary-search.d.ts +33 -0
  7. package/dist/cache/no-vary-search.d.ts.map +1 -0
  8. package/dist/cache/no-vary-search.js +148 -0
  9. package/dist/cache/no-vary-search.js.map +1 -0
  10. package/dist/cache/range.d.ts +120 -0
  11. package/dist/cache/range.d.ts.map +1 -0
  12. package/dist/cache/range.js +193 -0
  13. package/dist/cache/range.js.map +1 -0
  14. package/dist/cache/store.d.ts +111 -0
  15. package/dist/cache/store.d.ts.map +1 -0
  16. package/dist/cache/store.js +414 -0
  17. package/dist/cache/store.js.map +1 -0
  18. package/dist/cache/types.d.ts +69 -0
  19. package/dist/cache/types.d.ts.map +1 -0
  20. package/dist/cache/types.js +2 -0
  21. package/dist/cache/types.js.map +1 -0
  22. package/dist/cli/args.d.ts +4 -37
  23. package/dist/cli/args.d.ts.map +1 -1
  24. package/dist/cli/args.js +3 -4
  25. package/dist/cli/args.js.map +1 -1
  26. package/dist/cli/index.d.ts +0 -5
  27. package/dist/cli/index.d.ts.map +1 -1
  28. package/dist/cli/index.js +1 -6
  29. package/dist/cli/index.js.map +1 -1
  30. package/dist/cli/output.d.ts +14 -20
  31. package/dist/cli/output.d.ts.map +1 -1
  32. package/dist/cli/output.js +14 -20
  33. package/dist/cli/output.js.map +1 -1
  34. package/dist/cookies/jar.d.ts +33 -31
  35. package/dist/cookies/jar.d.ts.map +1 -1
  36. package/dist/cookies/jar.js +69 -33
  37. package/dist/cookies/jar.js.map +1 -1
  38. package/dist/cookies/parser.d.ts +14 -16
  39. package/dist/cookies/parser.d.ts.map +1 -1
  40. package/dist/cookies/parser.js +30 -13
  41. package/dist/cookies/parser.js.map +1 -1
  42. package/dist/cookies/psl-data.d.ts +1 -1
  43. package/dist/cookies/psl-data.js +1 -1
  44. package/dist/cookies/public-suffix.d.ts +5 -27
  45. package/dist/cookies/public-suffix.d.ts.map +1 -1
  46. package/dist/cookies/public-suffix.js +5 -37
  47. package/dist/cookies/public-suffix.js.map +1 -1
  48. package/dist/core/auth.d.ts +30 -0
  49. package/dist/core/auth.d.ts.map +1 -0
  50. package/dist/core/auth.js +34 -0
  51. package/dist/core/auth.js.map +1 -0
  52. package/dist/core/client.d.ts +28 -40
  53. package/dist/core/client.d.ts.map +1 -1
  54. package/dist/core/client.js +34 -41
  55. package/dist/core/client.js.map +1 -1
  56. package/dist/core/errors.d.ts +64 -88
  57. package/dist/core/errors.d.ts.map +1 -1
  58. package/dist/core/errors.js +64 -88
  59. package/dist/core/errors.js.map +1 -1
  60. package/dist/core/request.d.ts +63 -85
  61. package/dist/core/request.d.ts.map +1 -1
  62. package/dist/core/response.d.ts +64 -59
  63. package/dist/core/response.d.ts.map +1 -1
  64. package/dist/core/response.js +70 -52
  65. package/dist/core/response.js.map +1 -1
  66. package/dist/core/session.d.ts +81 -70
  67. package/dist/core/session.d.ts.map +1 -1
  68. package/dist/core/session.js +198 -71
  69. package/dist/core/session.js.map +1 -1
  70. package/dist/core/validation.d.ts +44 -42
  71. package/dist/core/validation.d.ts.map +1 -1
  72. package/dist/core/validation.js +47 -58
  73. package/dist/core/validation.js.map +1 -1
  74. package/dist/dns/cache.d.ts +59 -0
  75. package/dist/dns/cache.d.ts.map +1 -0
  76. package/dist/dns/cache.js +99 -0
  77. package/dist/dns/cache.js.map +1 -0
  78. package/dist/dns/codec.d.ts +39 -0
  79. package/dist/dns/codec.d.ts.map +1 -0
  80. package/dist/dns/codec.js +238 -0
  81. package/dist/dns/codec.js.map +1 -0
  82. package/dist/dns/doh-resolver.d.ts +38 -0
  83. package/dist/dns/doh-resolver.d.ts.map +1 -0
  84. package/dist/dns/doh-resolver.js +191 -0
  85. package/dist/dns/doh-resolver.js.map +1 -0
  86. package/dist/dns/dot-resolver.d.ts +89 -0
  87. package/dist/dns/dot-resolver.d.ts.map +1 -0
  88. package/dist/dns/dot-resolver.js +158 -0
  89. package/dist/dns/dot-resolver.js.map +1 -0
  90. package/dist/dns/https-rr.d.ts +40 -0
  91. package/dist/dns/https-rr.d.ts.map +1 -0
  92. package/dist/dns/https-rr.js +109 -0
  93. package/dist/dns/https-rr.js.map +1 -0
  94. package/dist/dns/types.d.ts +82 -0
  95. package/dist/dns/types.d.ts.map +1 -0
  96. package/dist/dns/types.js +23 -0
  97. package/dist/dns/types.js.map +1 -0
  98. package/dist/fingerprints/akamai.d.ts +3 -11
  99. package/dist/fingerprints/akamai.d.ts.map +1 -1
  100. package/dist/fingerprints/akamai.js +3 -11
  101. package/dist/fingerprints/akamai.js.map +1 -1
  102. package/dist/fingerprints/database.d.ts +6 -14
  103. package/dist/fingerprints/database.d.ts.map +1 -1
  104. package/dist/fingerprints/database.js +6 -14
  105. package/dist/fingerprints/database.js.map +1 -1
  106. package/dist/fingerprints/extensions.d.ts +56 -71
  107. package/dist/fingerprints/extensions.d.ts.map +1 -1
  108. package/dist/fingerprints/extensions.js +58 -71
  109. package/dist/fingerprints/extensions.js.map +1 -1
  110. package/dist/fingerprints/ja3.d.ts +12 -30
  111. package/dist/fingerprints/ja3.d.ts.map +1 -1
  112. package/dist/fingerprints/ja3.js +12 -30
  113. package/dist/fingerprints/ja3.js.map +1 -1
  114. package/dist/fingerprints/ja4.d.ts +18 -0
  115. package/dist/fingerprints/ja4.d.ts.map +1 -0
  116. package/dist/fingerprints/ja4.js +83 -0
  117. package/dist/fingerprints/ja4.js.map +1 -0
  118. package/dist/fingerprints/profiles/chrome.d.ts +18 -21
  119. package/dist/fingerprints/profiles/chrome.d.ts.map +1 -1
  120. package/dist/fingerprints/profiles/chrome.js +35 -31
  121. package/dist/fingerprints/profiles/chrome.js.map +1 -1
  122. package/dist/fingerprints/profiles/edge.d.ts +7 -10
  123. package/dist/fingerprints/profiles/edge.d.ts.map +1 -1
  124. package/dist/fingerprints/profiles/edge.js +7 -10
  125. package/dist/fingerprints/profiles/edge.js.map +1 -1
  126. package/dist/fingerprints/profiles/firefox.d.ts +8 -11
  127. package/dist/fingerprints/profiles/firefox.d.ts.map +1 -1
  128. package/dist/fingerprints/profiles/firefox.js +8 -11
  129. package/dist/fingerprints/profiles/firefox.js.map +1 -1
  130. package/dist/fingerprints/profiles/safari.d.ts +11 -14
  131. package/dist/fingerprints/profiles/safari.d.ts.map +1 -1
  132. package/dist/fingerprints/profiles/safari.js +11 -14
  133. package/dist/fingerprints/profiles/safari.js.map +1 -1
  134. package/dist/fingerprints/profiles/tor.d.ts +5 -8
  135. package/dist/fingerprints/profiles/tor.d.ts.map +1 -1
  136. package/dist/fingerprints/profiles/tor.js +5 -8
  137. package/dist/fingerprints/profiles/tor.js.map +1 -1
  138. package/dist/fingerprints/types.d.ts +42 -73
  139. package/dist/fingerprints/types.d.ts.map +1 -1
  140. package/dist/hsts/store.d.ts +39 -0
  141. package/dist/hsts/store.d.ts.map +1 -0
  142. package/dist/hsts/store.js +163 -0
  143. package/dist/hsts/store.js.map +1 -0
  144. package/dist/hsts/types.d.ts +24 -0
  145. package/dist/hsts/types.d.ts.map +1 -0
  146. package/dist/hsts/types.js +2 -0
  147. package/dist/hsts/types.js.map +1 -0
  148. package/dist/http/alt-svc.d.ts +67 -0
  149. package/dist/http/alt-svc.d.ts.map +1 -0
  150. package/dist/http/alt-svc.js +186 -0
  151. package/dist/http/alt-svc.js.map +1 -0
  152. package/dist/http/early-hints.d.ts +23 -0
  153. package/dist/http/early-hints.d.ts.map +1 -0
  154. package/dist/http/early-hints.js +33 -0
  155. package/dist/http/early-hints.js.map +1 -0
  156. package/dist/http/form-data.d.ts +17 -35
  157. package/dist/http/form-data.d.ts.map +1 -1
  158. package/dist/http/form-data.js +12 -34
  159. package/dist/http/form-data.js.map +1 -1
  160. package/dist/http/h1/client.d.ts +14 -26
  161. package/dist/http/h1/client.d.ts.map +1 -1
  162. package/dist/http/h1/client.js +29 -22
  163. package/dist/http/h1/client.js.map +1 -1
  164. package/dist/http/h1/encoder.d.ts +10 -17
  165. package/dist/http/h1/encoder.d.ts.map +1 -1
  166. package/dist/http/h1/encoder.js +10 -17
  167. package/dist/http/h1/encoder.js.map +1 -1
  168. package/dist/http/h1/parser.d.ts +22 -59
  169. package/dist/http/h1/parser.d.ts.map +1 -1
  170. package/dist/http/h1/parser.js +15 -47
  171. package/dist/http/h1/parser.js.map +1 -1
  172. package/dist/http/h2/client.d.ts +18 -59
  173. package/dist/http/h2/client.d.ts.map +1 -1
  174. package/dist/http/h2/client.js +29 -64
  175. package/dist/http/h2/client.js.map +1 -1
  176. package/dist/http/h2/frames.d.ts +53 -84
  177. package/dist/http/h2/frames.d.ts.map +1 -1
  178. package/dist/http/h2/frames.js +48 -76
  179. package/dist/http/h2/frames.js.map +1 -1
  180. package/dist/http/h2/hpack.d.ts +16 -35
  181. package/dist/http/h2/hpack.d.ts.map +1 -1
  182. package/dist/http/h2/hpack.js +16 -35
  183. package/dist/http/h2/hpack.js.map +1 -1
  184. package/dist/http/h3/detection.d.ts +15 -0
  185. package/dist/http/h3/detection.d.ts.map +1 -0
  186. package/dist/http/h3/detection.js +41 -0
  187. package/dist/http/h3/detection.js.map +1 -0
  188. package/dist/http/negotiator.d.ts +43 -33
  189. package/dist/http/negotiator.d.ts.map +1 -1
  190. package/dist/http/negotiator.js +99 -41
  191. package/dist/http/negotiator.js.map +1 -1
  192. package/dist/http/pool.d.ts +34 -64
  193. package/dist/http/pool.d.ts.map +1 -1
  194. package/dist/http/pool.js +22 -41
  195. package/dist/http/pool.js.map +1 -1
  196. package/dist/http/resumable-upload.d.ts +76 -0
  197. package/dist/http/resumable-upload.d.ts.map +1 -0
  198. package/dist/http/resumable-upload.js +104 -0
  199. package/dist/http/resumable-upload.js.map +1 -0
  200. package/dist/http/trailers.d.ts +29 -0
  201. package/dist/http/trailers.d.ts.map +1 -0
  202. package/dist/http/trailers.js +57 -0
  203. package/dist/http/trailers.js.map +1 -0
  204. package/dist/index.d.ts +36 -8
  205. package/dist/index.d.ts.map +1 -1
  206. package/dist/index.js +32 -1
  207. package/dist/index.js.map +1 -1
  208. package/dist/middleware/interceptor.d.ts +13 -32
  209. package/dist/middleware/interceptor.d.ts.map +1 -1
  210. package/dist/middleware/interceptor.js +11 -16
  211. package/dist/middleware/interceptor.js.map +1 -1
  212. package/dist/middleware/rate-limiter.d.ts +8 -17
  213. package/dist/middleware/rate-limiter.d.ts.map +1 -1
  214. package/dist/middleware/rate-limiter.js +15 -12
  215. package/dist/middleware/rate-limiter.js.map +1 -1
  216. package/dist/middleware/retry-after.d.ts +15 -0
  217. package/dist/middleware/retry-after.d.ts.map +1 -0
  218. package/dist/middleware/retry-after.js +36 -0
  219. package/dist/middleware/retry-after.js.map +1 -0
  220. package/dist/middleware/retry.d.ts +9 -18
  221. package/dist/middleware/retry.d.ts.map +1 -1
  222. package/dist/middleware/retry.js +12 -9
  223. package/dist/middleware/retry.js.map +1 -1
  224. package/dist/proxy/auth.d.ts +73 -0
  225. package/dist/proxy/auth.d.ts.map +1 -0
  226. package/dist/proxy/auth.js +128 -0
  227. package/dist/proxy/auth.js.map +1 -0
  228. package/dist/proxy/env-proxy.d.ts +11 -0
  229. package/dist/proxy/env-proxy.d.ts.map +1 -0
  230. package/dist/proxy/env-proxy.js +56 -0
  231. package/dist/proxy/env-proxy.js.map +1 -0
  232. package/dist/proxy/http-proxy.d.ts +13 -18
  233. package/dist/proxy/http-proxy.d.ts.map +1 -1
  234. package/dist/proxy/http-proxy.js +24 -14
  235. package/dist/proxy/http-proxy.js.map +1 -1
  236. package/dist/proxy/socks.d.ts +13 -20
  237. package/dist/proxy/socks.d.ts.map +1 -1
  238. package/dist/proxy/socks.js +6 -9
  239. package/dist/proxy/socks.js.map +1 -1
  240. package/dist/sse/parser.d.ts +47 -0
  241. package/dist/sse/parser.d.ts.map +1 -0
  242. package/dist/sse/parser.js +139 -0
  243. package/dist/sse/parser.js.map +1 -0
  244. package/dist/tls/constants.d.ts +15 -74
  245. package/dist/tls/constants.d.ts.map +1 -1
  246. package/dist/tls/constants.js +15 -74
  247. package/dist/tls/constants.js.map +1 -1
  248. package/dist/tls/ct.d.ts +78 -0
  249. package/dist/tls/ct.d.ts.map +1 -0
  250. package/dist/tls/ct.js +175 -0
  251. package/dist/tls/ct.js.map +1 -0
  252. package/dist/tls/early-data.d.ts +45 -0
  253. package/dist/tls/early-data.d.ts.map +1 -0
  254. package/dist/tls/early-data.js +46 -0
  255. package/dist/tls/early-data.js.map +1 -0
  256. package/dist/tls/ech.d.ts +130 -0
  257. package/dist/tls/ech.d.ts.map +1 -0
  258. package/dist/tls/ech.js +353 -0
  259. package/dist/tls/ech.js.map +1 -0
  260. package/dist/tls/keylog.d.ts +34 -0
  261. package/dist/tls/keylog.d.ts.map +1 -0
  262. package/dist/tls/keylog.js +64 -0
  263. package/dist/tls/keylog.js.map +1 -0
  264. package/dist/tls/node-engine.d.ts +15 -14
  265. package/dist/tls/node-engine.d.ts.map +1 -1
  266. package/dist/tls/node-engine.js +54 -14
  267. package/dist/tls/node-engine.js.map +1 -1
  268. package/dist/tls/ocsp.d.ts +55 -0
  269. package/dist/tls/ocsp.d.ts.map +1 -0
  270. package/dist/tls/ocsp.js +131 -0
  271. package/dist/tls/ocsp.js.map +1 -0
  272. package/dist/tls/pin-verification.d.ts +10 -0
  273. package/dist/tls/pin-verification.d.ts.map +1 -0
  274. package/dist/tls/pin-verification.js +28 -0
  275. package/dist/tls/pin-verification.js.map +1 -0
  276. package/dist/tls/session-cache.d.ts +58 -0
  277. package/dist/tls/session-cache.d.ts.map +1 -0
  278. package/dist/tls/session-cache.js +76 -0
  279. package/dist/tls/session-cache.js.map +1 -0
  280. package/dist/tls/stealth/client-hello.d.ts +34 -32
  281. package/dist/tls/stealth/client-hello.d.ts.map +1 -1
  282. package/dist/tls/stealth/client-hello.js +116 -11
  283. package/dist/tls/stealth/client-hello.js.map +1 -1
  284. package/dist/tls/stealth/engine.d.ts +5 -15
  285. package/dist/tls/stealth/engine.d.ts.map +1 -1
  286. package/dist/tls/stealth/engine.js +163 -47
  287. package/dist/tls/stealth/engine.js.map +1 -1
  288. package/dist/tls/stealth/handshake.d.ts +23 -32
  289. package/dist/tls/stealth/handshake.d.ts.map +1 -1
  290. package/dist/tls/stealth/handshake.js +112 -27
  291. package/dist/tls/stealth/handshake.js.map +1 -1
  292. package/dist/tls/stealth/key-schedule.d.ts +59 -86
  293. package/dist/tls/stealth/key-schedule.d.ts.map +1 -1
  294. package/dist/tls/stealth/key-schedule.js +46 -58
  295. package/dist/tls/stealth/key-schedule.js.map +1 -1
  296. package/dist/tls/stealth/record-layer.d.ts +52 -75
  297. package/dist/tls/stealth/record-layer.d.ts.map +1 -1
  298. package/dist/tls/stealth/record-layer.js +47 -63
  299. package/dist/tls/stealth/record-layer.js.map +1 -1
  300. package/dist/tls/stealth/tls12-handshake.d.ts +30 -0
  301. package/dist/tls/stealth/tls12-handshake.d.ts.map +1 -0
  302. package/dist/tls/stealth/tls12-handshake.js +470 -0
  303. package/dist/tls/stealth/tls12-handshake.js.map +1 -0
  304. package/dist/tls/types.d.ts +46 -48
  305. package/dist/tls/types.d.ts.map +1 -1
  306. package/dist/utils/buffer-reader.d.ts +26 -81
  307. package/dist/utils/buffer-reader.d.ts.map +1 -1
  308. package/dist/utils/buffer-reader.js +26 -81
  309. package/dist/utils/buffer-reader.js.map +1 -1
  310. package/dist/utils/buffer-writer.d.ts +30 -66
  311. package/dist/utils/buffer-writer.d.ts.map +1 -1
  312. package/dist/utils/buffer-writer.js +30 -66
  313. package/dist/utils/buffer-writer.js.map +1 -1
  314. package/dist/utils/compression.d.ts +18 -0
  315. package/dist/utils/compression.d.ts.map +1 -0
  316. package/dist/utils/compression.js +34 -0
  317. package/dist/utils/compression.js.map +1 -0
  318. package/dist/utils/dictionary-transport.d.ts +97 -0
  319. package/dist/utils/dictionary-transport.d.ts.map +1 -0
  320. package/dist/utils/dictionary-transport.js +171 -0
  321. package/dist/utils/dictionary-transport.js.map +1 -0
  322. package/dist/utils/encoding.d.ts +12 -28
  323. package/dist/utils/encoding.d.ts.map +1 -1
  324. package/dist/utils/encoding.js +77 -40
  325. package/dist/utils/encoding.js.map +1 -1
  326. package/dist/utils/happy-eyeballs.d.ts +20 -7
  327. package/dist/utils/happy-eyeballs.d.ts.map +1 -1
  328. package/dist/utils/happy-eyeballs.js +57 -25
  329. package/dist/utils/happy-eyeballs.js.map +1 -1
  330. package/dist/utils/logger.d.ts +54 -81
  331. package/dist/utils/logger.d.ts.map +1 -1
  332. package/dist/utils/logger.js +92 -64
  333. package/dist/utils/logger.js.map +1 -1
  334. package/dist/utils/tcp-fast-open.d.ts +30 -0
  335. package/dist/utils/tcp-fast-open.d.ts.map +1 -0
  336. package/dist/utils/tcp-fast-open.js +36 -0
  337. package/dist/utils/tcp-fast-open.js.map +1 -0
  338. package/dist/utils/url.d.ts +18 -25
  339. package/dist/utils/url.d.ts.map +1 -1
  340. package/dist/utils/url.js +18 -25
  341. package/dist/utils/url.js.map +1 -1
  342. package/dist/ws/client.d.ts +35 -52
  343. package/dist/ws/client.d.ts.map +1 -1
  344. package/dist/ws/client.js +92 -37
  345. package/dist/ws/client.js.map +1 -1
  346. package/dist/ws/frame.d.ts +27 -42
  347. package/dist/ws/frame.d.ts.map +1 -1
  348. package/dist/ws/frame.js +25 -37
  349. package/dist/ws/frame.js.map +1 -1
  350. package/dist/ws/permessage-deflate.d.ts +53 -0
  351. package/dist/ws/permessage-deflate.d.ts.map +1 -0
  352. package/dist/ws/permessage-deflate.js +140 -0
  353. package/dist/ws/permessage-deflate.js.map +1 -0
  354. package/package.json +62 -62
@@ -1,143 +1,128 @@
1
1
  /**
2
- * Builds the SNI (Server Name Indication) extension payload for the given
3
- * hostname, encoded as a TLS `HostName` name list structure per RFC 6066.
2
+ * Build Server Name Indication extension data.
4
3
  *
5
- * @param {string} hostname - The ASCII server name to advertise.
6
- * @returns {Buffer} Encoded SNI extension data.
4
+ * @param {string} hostname - Target server hostname.
5
+ * @returns {Buffer} Encoded SNI extension payload.
7
6
  */
8
7
  export declare function sniData(hostname: string): Buffer;
9
8
  /**
10
- * Builds the `supported_versions` extension payload listing the given TLS
11
- * version codes in the order provided.
9
+ * Build supported_versions extension data.
12
10
  *
13
- * @param {number[]} versions - Ordered TLS version codes (e.g. `[0x0304, 0x0303]`).
14
- * @returns {Buffer} Encoded supported_versions extension data.
11
+ * @param {number[]} versions - TLS version code points.
12
+ * @returns {Buffer} Encoded extension payload.
15
13
  */
16
14
  export declare function supportedVersionsData(versions: number[]): Buffer;
17
15
  /**
18
- * Builds the `supported_groups` extension payload listing the given named
19
- * group codes (elliptic curves and finite-field groups).
16
+ * Build supported_groups (named curves) extension data.
20
17
  *
21
- * @param {number[]} groups - Ordered named group codes (e.g. `[0x001d, 0x0017]`).
22
- * @returns {Buffer} Encoded supported_groups extension data.
18
+ * @param {number[]} groups - Named group code points.
19
+ * @returns {Buffer} Encoded extension payload.
23
20
  */
24
21
  export declare function supportedGroupsData(groups: number[]): Buffer;
25
22
  /**
26
- * Builds the `ec_point_formats` extension payload specifying the supported
27
- * EC point encoding formats.
23
+ * Build ec_point_formats extension data.
28
24
  *
29
- * @param {number[]} formats - EC point format codes (e.g. `[0]` for uncompressed).
30
- * @returns {Buffer} Encoded ec_point_formats extension data.
25
+ * @param {number[]} formats - EC point format identifiers.
26
+ * @returns {Buffer} Encoded extension payload.
31
27
  */
32
28
  export declare function ecPointFormatsData(formats: number[]): Buffer;
33
29
  /**
34
- * Builds the `signature_algorithms` extension payload listing the supported
35
- * signature scheme codes in the order provided.
30
+ * Build signature_algorithms extension data.
36
31
  *
37
- * @param {number[]} algs - Ordered signature scheme codes (e.g. `[0x0403, 0x0804]`).
38
- * @returns {Buffer} Encoded signature_algorithms extension data.
32
+ * @param {number[]} algs - Signature algorithm code points.
33
+ * @returns {Buffer} Encoded extension payload.
39
34
  */
40
35
  export declare function signatureAlgorithmsData(algs: number[]): Buffer;
41
36
  /**
42
- * Builds the ALPN (Application-Layer Protocol Negotiation) extension payload
43
- * advertising the given protocol name strings in preference order.
37
+ * Build Application-Layer Protocol Negotiation extension data.
44
38
  *
45
- * @param {string[]} protocols - Protocol names in preference order (e.g. `['h2', 'http/1.1']`).
46
- * @returns {Buffer} Encoded ALPN extension data.
39
+ * @param {string[]} protocols - ALPN protocol identifier strings.
40
+ * @returns {Buffer} Encoded extension payload.
47
41
  */
48
42
  export declare function alpnData(protocols: string[]): Buffer;
49
43
  /**
50
- * Builds the `compress_certificate` extension payload listing the supported
51
- * certificate compression algorithm codes (RFC 8879).
44
+ * Build compress_certificate extension data.
52
45
  *
53
- * @param {number[]} algorithms - Compression algorithm codes (e.g. `[2]` for brotli).
54
- * @returns {Buffer} Encoded compress_certificate extension data.
46
+ * @param {number[]} algorithms - Certificate compression algorithm identifiers.
47
+ * @returns {Buffer} Encoded extension payload.
55
48
  */
56
49
  export declare function compressCertData(algorithms: number[]): Buffer;
57
50
  /**
58
- * Builds the `psk_key_exchange_modes` extension payload specifying the
59
- * supported PSK key exchange mode codes.
51
+ * Build psk_key_exchange_modes extension data.
60
52
  *
61
- * @param {number[]} modes - PSK key exchange mode codes (e.g. `[1]` for psk_dhe_ke).
62
- * @returns {Buffer} Encoded psk_key_exchange_modes extension data.
53
+ * @param {number[]} modes - PSK key exchange mode identifiers.
54
+ * @returns {Buffer} Encoded extension payload.
63
55
  */
64
56
  export declare function pskKeyExchangeModesData(modes: number[]): Buffer;
65
57
  /**
66
- * Returns an empty buffer as a placeholder for the `key_share` extension.
67
- * The actual key share data is computed and injected at ClientHello build time
68
- * by the handshake engine, which needs the private keys to complete the DH.
58
+ * Build a key_share extension placeholder (populated later during handshake).
69
59
  *
70
- * @param {number[]} groups - Named group codes for which key shares will be generated.
71
- * @returns {Buffer} Empty placeholder buffer.
60
+ * @param {number[]} groups - Named groups to reserve key share entries for.
61
+ * @returns {Buffer} Empty buffer placeholder.
72
62
  */
73
- export declare function keySharePlaceholder(groups: number[]): Buffer;
63
+ export declare function keySharePlaceholder(_groups: number[]): Buffer;
74
64
  /**
75
- * Builds the `status_request` extension payload requesting OCSP stapling
76
- * from the server (RFC 6066 §8).
65
+ * Build status_request (OCSP stapling) extension data.
77
66
  *
78
- * @returns {Buffer} Encoded status_request extension data.
67
+ * @returns {Buffer} Encoded extension payload.
79
68
  */
80
69
  export declare function statusRequestData(): Buffer;
81
70
  /**
82
- * Returns an empty buffer for the `session_ticket` extension, signalling
83
- * that the client supports TLS session tickets but has none to present.
71
+ * Build an empty session_ticket extension.
84
72
  *
85
- * @returns {Buffer} Empty session_ticket extension payload.
73
+ * @returns {Buffer} Empty buffer for session ticket extension.
86
74
  */
87
75
  export declare function sessionTicketData(): Buffer;
88
76
  /**
89
- * Returns an empty buffer for the `extended_master_secret` extension (RFC 7627),
90
- * which signals support for the extended master secret computation.
77
+ * Build an empty extended_master_secret extension.
91
78
  *
92
- * @returns {Buffer} Empty extended_master_secret extension payload.
79
+ * @returns {Buffer} Empty buffer signaling extended master secret support.
93
80
  */
94
81
  export declare function extendedMasterSecretData(): Buffer;
95
82
  /**
96
- * Builds the `renegotiation_info` extension payload with an empty renegotiated
97
- * connection field, indicating that this is an initial TLS handshake (RFC 5746).
83
+ * Build renegotiation_info extension data.
98
84
  *
99
- * @returns {Buffer} Encoded renegotiation_info extension data (`[0x00]`).
85
+ * @returns {Buffer} Encoded renegotiation info with zero-length field.
100
86
  */
101
87
  export declare function renegotiationInfoData(): Buffer;
102
88
  /**
103
- * Returns an empty buffer for the `signed_certificate_timestamp` extension
104
- * (RFC 6962), signalling SCT support without providing any timestamps.
89
+ * Build an empty signed_certificate_timestamp extension.
105
90
  *
106
- * @returns {Buffer} Empty SCT extension payload.
91
+ * @returns {Buffer} Empty buffer requesting SCT data.
107
92
  */
108
93
  export declare function sctData(): Buffer;
109
94
  /**
110
- * Builds the `record_size_limit` extension payload (RFC 8449) specifying the
111
- * maximum plaintext record size the client is willing to receive.
95
+ * Build record_size_limit extension data.
112
96
  *
113
- * @param {number} limit - Maximum record size in bytes (typically 16384 for browsers).
114
- * @returns {Buffer} Encoded record_size_limit extension data.
97
+ * @param {number} limit - Maximum record fragment size.
98
+ * @returns {Buffer} Encoded extension payload.
115
99
  */
116
100
  export declare function recordSizeLimitData(limit: number): Buffer;
117
101
  /**
118
- * Builds the `delegated_credentials` extension payload (RFC 9345) listing
119
- * the signature algorithms acceptable for use with delegated credentials.
102
+ * Build delegated_credentials extension data.
120
103
  *
121
- * @param {number[]} sigAlgs - Signature algorithm codes acceptable for delegated credentials.
122
- * @returns {Buffer} Encoded delegated_credentials extension data.
104
+ * @param {number[]} sigAlgs - Signature algorithm code points accepted for delegated credentials.
105
+ * @returns {Buffer} Encoded extension payload.
123
106
  */
124
107
  export declare function delegatedCredentialsData(sigAlgs: number[]): Buffer;
125
108
  /**
126
- * Builds the `application_settings` (ALPS) extension payload for the given
127
- * protocol names, a Chrome-specific extension that negotiates application-level
128
- * settings over TLS.
109
+ * Build application_settings (ALPS) extension data.
129
110
  *
130
- * @param {string[]} protocols - ALPN protocol names to include in the ALPS extension.
131
- * @returns {Buffer} Encoded application_settings extension data.
111
+ * @param {string[]} protocols - Protocol identifier strings for application settings.
112
+ * @returns {Buffer} Encoded extension payload.
132
113
  */
133
114
  export declare function applicationSettingsData(protocols: string[]): Buffer;
134
115
  /**
135
- * Builds a synthetic Encrypted Client Hello (ECH) GREASE extension payload
136
- * (draft-ietf-tls-esni). This does not perform real ECH; it emits a
137
- * deterministic fake payload that matches the extension structure browsers send
138
- * when the server does not advertise real ECH support.
116
+ * Build an Encrypted Client Hello GREASE extension.
139
117
  *
140
- * @returns {Buffer} Encoded ECH GREASE extension data.
118
+ * @returns {Buffer} Deterministic ECH GREASE payload for fingerprint consistency.
141
119
  */
142
120
  export declare function echGreaseData(): Buffer;
121
+ /**
122
+ * Build a padding extension of the specified length.
123
+ *
124
+ * @param {number} paddingLength - Number of zero bytes to include.
125
+ * @returns {Buffer} Zero-filled buffer of the requested length.
126
+ */
127
+ export declare function paddingData(paddingLength: number): Buffer;
143
128
  //# sourceMappingURL=extensions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../src/fingerprints/extensions.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAShD;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAKhE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAK5D;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAK5D;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAK9D;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAcpD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,CAK7D;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAK/D;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAE5D;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAM1C;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,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AM,CAE7D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAM1C;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAEjD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;;;GAIG;AACH,wBAAgB,OAAO,IAAI,MAAM,CAEhC;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIzD;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAKlE;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,CAcnE;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAgBtC;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM,CAEzD"}
@@ -1,10 +1,9 @@
1
1
  import { BufferWriter } from "../utils/buffer-writer.js";
2
2
  /**
3
- * Builds the SNI (Server Name Indication) extension payload for the given
4
- * hostname, encoded as a TLS `HostName` name list structure per RFC 6066.
3
+ * Build Server Name Indication extension data.
5
4
  *
6
- * @param {string} hostname - The ASCII server name to advertise.
7
- * @returns {Buffer} Encoded SNI extension data.
5
+ * @param {string} hostname - Target server hostname.
6
+ * @returns {Buffer} Encoded SNI extension payload.
8
7
  */
9
8
  export function sniData(hostname) {
10
9
  const host = Buffer.from(hostname, "ascii");
@@ -17,11 +16,10 @@ export function sniData(hostname) {
17
16
  return w.toBuffer();
18
17
  }
19
18
  /**
20
- * Builds the `supported_versions` extension payload listing the given TLS
21
- * version codes in the order provided.
19
+ * Build supported_versions extension data.
22
20
  *
23
- * @param {number[]} versions - Ordered TLS version codes (e.g. `[0x0304, 0x0303]`).
24
- * @returns {Buffer} Encoded supported_versions extension data.
21
+ * @param {number[]} versions - TLS version code points.
22
+ * @returns {Buffer} Encoded extension payload.
25
23
  */
26
24
  export function supportedVersionsData(versions) {
27
25
  const w = new BufferWriter(1 + versions.length * 2);
@@ -31,11 +29,10 @@ export function supportedVersionsData(versions) {
31
29
  return w.toBuffer();
32
30
  }
33
31
  /**
34
- * Builds the `supported_groups` extension payload listing the given named
35
- * group codes (elliptic curves and finite-field groups).
32
+ * Build supported_groups (named curves) extension data.
36
33
  *
37
- * @param {number[]} groups - Ordered named group codes (e.g. `[0x001d, 0x0017]`).
38
- * @returns {Buffer} Encoded supported_groups extension data.
34
+ * @param {number[]} groups - Named group code points.
35
+ * @returns {Buffer} Encoded extension payload.
39
36
  */
40
37
  export function supportedGroupsData(groups) {
41
38
  const w = new BufferWriter(2 + groups.length * 2);
@@ -45,11 +42,10 @@ export function supportedGroupsData(groups) {
45
42
  return w.toBuffer();
46
43
  }
47
44
  /**
48
- * Builds the `ec_point_formats` extension payload specifying the supported
49
- * EC point encoding formats.
45
+ * Build ec_point_formats extension data.
50
46
  *
51
- * @param {number[]} formats - EC point format codes (e.g. `[0]` for uncompressed).
52
- * @returns {Buffer} Encoded ec_point_formats extension data.
47
+ * @param {number[]} formats - EC point format identifiers.
48
+ * @returns {Buffer} Encoded extension payload.
53
49
  */
54
50
  export function ecPointFormatsData(formats) {
55
51
  const w = new BufferWriter(1 + formats.length);
@@ -59,11 +55,10 @@ export function ecPointFormatsData(formats) {
59
55
  return w.toBuffer();
60
56
  }
61
57
  /**
62
- * Builds the `signature_algorithms` extension payload listing the supported
63
- * signature scheme codes in the order provided.
58
+ * Build signature_algorithms extension data.
64
59
  *
65
- * @param {number[]} algs - Ordered signature scheme codes (e.g. `[0x0403, 0x0804]`).
66
- * @returns {Buffer} Encoded signature_algorithms extension data.
60
+ * @param {number[]} algs - Signature algorithm code points.
61
+ * @returns {Buffer} Encoded extension payload.
67
62
  */
68
63
  export function signatureAlgorithmsData(algs) {
69
64
  const w = new BufferWriter(2 + algs.length * 2);
@@ -73,11 +68,10 @@ export function signatureAlgorithmsData(algs) {
73
68
  return w.toBuffer();
74
69
  }
75
70
  /**
76
- * Builds the ALPN (Application-Layer Protocol Negotiation) extension payload
77
- * advertising the given protocol name strings in preference order.
71
+ * Build Application-Layer Protocol Negotiation extension data.
78
72
  *
79
- * @param {string[]} protocols - Protocol names in preference order (e.g. `['h2', 'http/1.1']`).
80
- * @returns {Buffer} Encoded ALPN extension data.
73
+ * @param {string[]} protocols - ALPN protocol identifier strings.
74
+ * @returns {Buffer} Encoded extension payload.
81
75
  */
82
76
  export function alpnData(protocols) {
83
77
  let totalLen = 0;
@@ -95,11 +89,10 @@ export function alpnData(protocols) {
95
89
  return w.toBuffer();
96
90
  }
97
91
  /**
98
- * Builds the `compress_certificate` extension payload listing the supported
99
- * certificate compression algorithm codes (RFC 8879).
92
+ * Build compress_certificate extension data.
100
93
  *
101
- * @param {number[]} algorithms - Compression algorithm codes (e.g. `[2]` for brotli).
102
- * @returns {Buffer} Encoded compress_certificate extension data.
94
+ * @param {number[]} algorithms - Certificate compression algorithm identifiers.
95
+ * @returns {Buffer} Encoded extension payload.
103
96
  */
104
97
  export function compressCertData(algorithms) {
105
98
  const w = new BufferWriter(1 + algorithms.length * 2);
@@ -109,11 +102,10 @@ export function compressCertData(algorithms) {
109
102
  return w.toBuffer();
110
103
  }
111
104
  /**
112
- * Builds the `psk_key_exchange_modes` extension payload specifying the
113
- * supported PSK key exchange mode codes.
105
+ * Build psk_key_exchange_modes extension data.
114
106
  *
115
- * @param {number[]} modes - PSK key exchange mode codes (e.g. `[1]` for psk_dhe_ke).
116
- * @returns {Buffer} Encoded psk_key_exchange_modes extension data.
107
+ * @param {number[]} modes - PSK key exchange mode identifiers.
108
+ * @returns {Buffer} Encoded extension payload.
117
109
  */
118
110
  export function pskKeyExchangeModesData(modes) {
119
111
  const w = new BufferWriter(1 + modes.length);
@@ -123,21 +115,18 @@ export function pskKeyExchangeModesData(modes) {
123
115
  return w.toBuffer();
124
116
  }
125
117
  /**
126
- * Returns an empty buffer as a placeholder for the `key_share` extension.
127
- * The actual key share data is computed and injected at ClientHello build time
128
- * by the handshake engine, which needs the private keys to complete the DH.
118
+ * Build a key_share extension placeholder (populated later during handshake).
129
119
  *
130
- * @param {number[]} groups - Named group codes for which key shares will be generated.
131
- * @returns {Buffer} Empty placeholder buffer.
120
+ * @param {number[]} groups - Named groups to reserve key share entries for.
121
+ * @returns {Buffer} Empty buffer placeholder.
132
122
  */
133
- export function keySharePlaceholder(groups) {
123
+ export function keySharePlaceholder(_groups) {
134
124
  return Buffer.alloc(0);
135
125
  }
136
126
  /**
137
- * Builds the `status_request` extension payload requesting OCSP stapling
138
- * from the server (RFC 6066 §8).
127
+ * Build status_request (OCSP stapling) extension data.
139
128
  *
140
- * @returns {Buffer} Encoded status_request extension data.
129
+ * @returns {Buffer} Encoded extension payload.
141
130
  */
142
131
  export function statusRequestData() {
143
132
  const w = new BufferWriter(5);
@@ -147,47 +136,42 @@ export function statusRequestData() {
147
136
  return w.toBuffer();
148
137
  }
149
138
  /**
150
- * Returns an empty buffer for the `session_ticket` extension, signalling
151
- * that the client supports TLS session tickets but has none to present.
139
+ * Build an empty session_ticket extension.
152
140
  *
153
- * @returns {Buffer} Empty session_ticket extension payload.
141
+ * @returns {Buffer} Empty buffer for session ticket extension.
154
142
  */
155
143
  export function sessionTicketData() {
156
144
  return Buffer.alloc(0);
157
145
  }
158
146
  /**
159
- * Returns an empty buffer for the `extended_master_secret` extension (RFC 7627),
160
- * which signals support for the extended master secret computation.
147
+ * Build an empty extended_master_secret extension.
161
148
  *
162
- * @returns {Buffer} Empty extended_master_secret extension payload.
149
+ * @returns {Buffer} Empty buffer signaling extended master secret support.
163
150
  */
164
151
  export function extendedMasterSecretData() {
165
152
  return Buffer.alloc(0);
166
153
  }
167
154
  /**
168
- * Builds the `renegotiation_info` extension payload with an empty renegotiated
169
- * connection field, indicating that this is an initial TLS handshake (RFC 5746).
155
+ * Build renegotiation_info extension data.
170
156
  *
171
- * @returns {Buffer} Encoded renegotiation_info extension data (`[0x00]`).
157
+ * @returns {Buffer} Encoded renegotiation info with zero-length field.
172
158
  */
173
159
  export function renegotiationInfoData() {
174
160
  return Buffer.from([0]);
175
161
  }
176
162
  /**
177
- * Returns an empty buffer for the `signed_certificate_timestamp` extension
178
- * (RFC 6962), signalling SCT support without providing any timestamps.
163
+ * Build an empty signed_certificate_timestamp extension.
179
164
  *
180
- * @returns {Buffer} Empty SCT extension payload.
165
+ * @returns {Buffer} Empty buffer requesting SCT data.
181
166
  */
182
167
  export function sctData() {
183
168
  return Buffer.alloc(0);
184
169
  }
185
170
  /**
186
- * Builds the `record_size_limit` extension payload (RFC 8449) specifying the
187
- * maximum plaintext record size the client is willing to receive.
171
+ * Build record_size_limit extension data.
188
172
  *
189
- * @param {number} limit - Maximum record size in bytes (typically 16384 for browsers).
190
- * @returns {Buffer} Encoded record_size_limit extension data.
173
+ * @param {number} limit - Maximum record fragment size.
174
+ * @returns {Buffer} Encoded extension payload.
191
175
  */
192
176
  export function recordSizeLimitData(limit) {
193
177
  const w = new BufferWriter(2);
@@ -195,11 +179,10 @@ export function recordSizeLimitData(limit) {
195
179
  return w.toBuffer();
196
180
  }
197
181
  /**
198
- * Builds the `delegated_credentials` extension payload (RFC 9345) listing
199
- * the signature algorithms acceptable for use with delegated credentials.
182
+ * Build delegated_credentials extension data.
200
183
  *
201
- * @param {number[]} sigAlgs - Signature algorithm codes acceptable for delegated credentials.
202
- * @returns {Buffer} Encoded delegated_credentials extension data.
184
+ * @param {number[]} sigAlgs - Signature algorithm code points accepted for delegated credentials.
185
+ * @returns {Buffer} Encoded extension payload.
203
186
  */
204
187
  export function delegatedCredentialsData(sigAlgs) {
205
188
  const w = new BufferWriter(2 + sigAlgs.length * 2);
@@ -209,12 +192,10 @@ export function delegatedCredentialsData(sigAlgs) {
209
192
  return w.toBuffer();
210
193
  }
211
194
  /**
212
- * Builds the `application_settings` (ALPS) extension payload for the given
213
- * protocol names, a Chrome-specific extension that negotiates application-level
214
- * settings over TLS.
195
+ * Build application_settings (ALPS) extension data.
215
196
  *
216
- * @param {string[]} protocols - ALPN protocol names to include in the ALPS extension.
217
- * @returns {Buffer} Encoded application_settings extension data.
197
+ * @param {string[]} protocols - Protocol identifier strings for application settings.
198
+ * @returns {Buffer} Encoded extension payload.
218
199
  */
219
200
  export function applicationSettingsData(protocols) {
220
201
  let totalLen = 0;
@@ -232,12 +213,9 @@ export function applicationSettingsData(protocols) {
232
213
  return w.toBuffer();
233
214
  }
234
215
  /**
235
- * Builds a synthetic Encrypted Client Hello (ECH) GREASE extension payload
236
- * (draft-ietf-tls-esni). This does not perform real ECH; it emits a
237
- * deterministic fake payload that matches the extension structure browsers send
238
- * when the server does not advertise real ECH support.
216
+ * Build an Encrypted Client Hello GREASE extension.
239
217
  *
240
- * @returns {Buffer} Encoded ECH GREASE extension data.
218
+ * @returns {Buffer} Deterministic ECH GREASE payload for fingerprint consistency.
241
219
  */
242
220
  export function echGreaseData() {
243
221
  const w = new BufferWriter(8 + 32);
@@ -258,4 +236,13 @@ export function echGreaseData() {
258
236
  w.writeBytes(payload);
259
237
  return w.toBuffer();
260
238
  }
239
+ /**
240
+ * Build a padding extension of the specified length.
241
+ *
242
+ * @param {number} paddingLength - Number of zero bytes to include.
243
+ * @returns {Buffer} Zero-filled buffer of the requested length.
244
+ */
245
+ export function paddingData(paddingLength) {
246
+ return Buffer.alloc(Math.max(0, paddingLength));
247
+ }
261
248
  //# sourceMappingURL=extensions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.js","sourceRoot":"","sources":["../../src/fingerprints/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAGzD;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CAAC,QAAgB;IACtC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,OAAO,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CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;IACtB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAChB,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAClB,MAAM,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAC7B,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;QAAE,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;IAC1D,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAClB,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;IAClB,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE;QAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC;IAC/D,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACtB,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;AACtB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,aAAqB;IAC/C,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC;AAClD,CAAC"}
@@ -1,48 +1,30 @@
1
1
  import type { TLSProfile } from "./types.js";
2
2
  /**
3
- * Computes the JA3 string representation of a TLS profile. The string is a
4
- * comma-separated tuple of `version`, cipher codes, extension type codes,
5
- * supported-group codes, and EC point format codes, all encoded as
6
- * dash-separated decimal lists (GREASE values filtered out).
3
+ * Generate a JA3 fingerprint string from a TLS profile.
7
4
  *
8
- * @param {TLSProfile} profile - The TLS profile to fingerprint.
9
- * @returns {string} The JA3 fingerprint string.
10
- *
11
- * @example
12
- * const str = ja3String(chromeLatest.tls);
13
- * // => "771,4865-4866-...,0-23-...,29-23-24,0"
5
+ * @param {TLSProfile} profile - TLS profile to fingerprint.
6
+ * @returns {string} Comma-separated JA3 string of version, ciphers, extensions, groups, and point formats.
14
7
  */
15
8
  export declare function ja3String(profile: TLSProfile): string;
16
9
  /**
17
- * Computes the MD5 hash of the JA3 string for the given TLS profile.
18
- * The resulting 32-character hex digest is the canonical JA3 fingerprint
19
- * used in network monitoring and fingerprinting detection.
20
- *
21
- * @param {TLSProfile} profile - The TLS profile to fingerprint.
22
- * @returns {string} The 32-character lowercase hex JA3 MD5 hash.
10
+ * Compute the MD5 hash of the JA3 fingerprint string.
23
11
  *
24
- * @example
25
- * const hash = ja3Hash(chromeLatest.tls);
26
- * // => "cd08e31494f9531f560d64c695473da9"
12
+ * @param {TLSProfile} profile - TLS profile to fingerprint.
13
+ * @returns {string} Hex-encoded MD5 digest.
27
14
  */
28
15
  export declare function ja3Hash(profile: TLSProfile): string;
29
16
  /**
30
- * Computes the JA3N (normalised) string for a TLS profile. Unlike
31
- * {@link ja3String}, all numeric lists are sorted before joining, which
32
- * makes the fingerprint order-independent and useful for comparing profiles
33
- * that advertise the same capabilities in different orders.
17
+ * Generate a normalized JA3 fingerprint string with sorted components.
34
18
  *
35
- * @param {TLSProfile} profile - The TLS profile to fingerprint.
36
- * @returns {string} The JA3N fingerprint string with sorted field lists.
19
+ * @param {TLSProfile} profile - TLS profile to fingerprint.
20
+ * @returns {string} Comma-separated JA3n string with sorted ciphers, extensions, and groups.
37
21
  */
38
22
  export declare function ja3nString(profile: TLSProfile): string;
39
23
  /**
40
- * Computes the MD5 hash of the JA3N (normalised) string for the given TLS
41
- * profile. JA3N hashes are order-independent, making them suitable for
42
- * grouping profiles by capability set regardless of advertisement order.
24
+ * Compute the MD5 hash of the normalized JA3 fingerprint string.
43
25
  *
44
- * @param {TLSProfile} profile - The TLS profile to fingerprint.
45
- * @returns {string} The 32-character lowercase hex JA3N MD5 hash.
26
+ * @param {TLSProfile} profile - TLS profile to fingerprint.
27
+ * @returns {string} Hex-encoded MD5 digest.
46
28
  */
47
29
  export declare function ja3nHash(profile: TLSProfile): string;
48
30
  //# sourceMappingURL=ja3.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ja3.d.ts","sourceRoot":"","sources":["../../src/fingerprints/ja3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAY7C;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAQrD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAEnD;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CActD;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAEpD"}
1
+ {"version":3,"file":"ja3.d.ts","sourceRoot":"","sources":["../../src/fingerprints/ja3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAY7C;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAQrD;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CActD;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,UAAU,GAAG,MAAM,CAEpD"}
@@ -8,17 +8,10 @@ function filterGrease(values) {
8
8
  return values.filter((v) => !isGrease(v));
9
9
  }
10
10
  /**
11
- * Computes the JA3 string representation of a TLS profile. The string is a
12
- * comma-separated tuple of `version`, cipher codes, extension type codes,
13
- * supported-group codes, and EC point format codes, all encoded as
14
- * dash-separated decimal lists (GREASE values filtered out).
11
+ * Generate a JA3 fingerprint string from a TLS profile.
15
12
  *
16
- * @param {TLSProfile} profile - The TLS profile to fingerprint.
17
- * @returns {string} The JA3 fingerprint string.
18
- *
19
- * @example
20
- * const str = ja3String(chromeLatest.tls);
21
- * // => "771,4865-4866-...,0-23-...,29-23-24,0"
13
+ * @param {TLSProfile} profile - TLS profile to fingerprint.
14
+ * @returns {string} Comma-separated JA3 string of version, ciphers, extensions, groups, and point formats.
22
15
  */
23
16
  export function ja3String(profile) {
24
17
  const version = profile.clientVersion;
@@ -29,28 +22,19 @@ export function ja3String(profile) {
29
22
  return `${version},${ciphers},${extensions},${groups},${formats}`;
30
23
  }
31
24
  /**
32
- * Computes the MD5 hash of the JA3 string for the given TLS profile.
33
- * The resulting 32-character hex digest is the canonical JA3 fingerprint
34
- * used in network monitoring and fingerprinting detection.
35
- *
36
- * @param {TLSProfile} profile - The TLS profile to fingerprint.
37
- * @returns {string} The 32-character lowercase hex JA3 MD5 hash.
25
+ * Compute the MD5 hash of the JA3 fingerprint string.
38
26
  *
39
- * @example
40
- * const hash = ja3Hash(chromeLatest.tls);
41
- * // => "cd08e31494f9531f560d64c695473da9"
27
+ * @param {TLSProfile} profile - TLS profile to fingerprint.
28
+ * @returns {string} Hex-encoded MD5 digest.
42
29
  */
43
30
  export function ja3Hash(profile) {
44
31
  return createHash("md5").update(ja3String(profile)).digest("hex");
45
32
  }
46
33
  /**
47
- * Computes the JA3N (normalised) string for a TLS profile. Unlike
48
- * {@link ja3String}, all numeric lists are sorted before joining, which
49
- * makes the fingerprint order-independent and useful for comparing profiles
50
- * that advertise the same capabilities in different orders.
34
+ * Generate a normalized JA3 fingerprint string with sorted components.
51
35
  *
52
- * @param {TLSProfile} profile - The TLS profile to fingerprint.
53
- * @returns {string} The JA3N fingerprint string with sorted field lists.
36
+ * @param {TLSProfile} profile - TLS profile to fingerprint.
37
+ * @returns {string} Comma-separated JA3n string with sorted ciphers, extensions, and groups.
54
38
  */
55
39
  export function ja3nString(profile) {
56
40
  const version = profile.clientVersion;
@@ -67,12 +51,10 @@ export function ja3nString(profile) {
67
51
  return `${version},${ciphers},${extensions},${groups},${formats}`;
68
52
  }
69
53
  /**
70
- * Computes the MD5 hash of the JA3N (normalised) string for the given TLS
71
- * profile. JA3N hashes are order-independent, making them suitable for
72
- * grouping profiles by capability set regardless of advertisement order.
54
+ * Compute the MD5 hash of the normalized JA3 fingerprint string.
73
55
  *
74
- * @param {TLSProfile} profile - The TLS profile to fingerprint.
75
- * @returns {string} The 32-character lowercase hex JA3N MD5 hash.
56
+ * @param {TLSProfile} profile - TLS profile to fingerprint.
57
+ * @returns {string} Hex-encoded MD5 digest.
76
58
  */
77
59
  export function ja3nHash(profile) {
78
60
  return createHash("md5").update(ja3nString(profile)).digest("hex");