re2 1.25.2 → 1.26.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.
package/README.md CHANGED
@@ -20,7 +20,7 @@ It also provides `String`-based regular expression methods. The constructor acce
20
20
  It can work with [Node.js Buffers](https://nodejs.org/api/buffer.html) directly, reducing overhead and making processing of long files fast.
21
21
 
22
22
  The project is a C++ addon built with [nan](https://github.com/nodejs/nan). It cannot be used in web browsers.
23
- All documentation is in this README and in the [wiki](https://github.com/uhop/node-re2/wiki).
23
+ All documentation is in this README and in the [wiki](https://github.com/uhop/node-re2/wiki) — browse the [index](https://github.com/uhop/node-re2/wiki/Home), or [search it](https://uhop.github.io/wiki-search/app/?wiki=uhop/node-re2) by name.
24
24
 
25
25
  ## Why use node-re2?
26
26
 
@@ -284,9 +284,9 @@ and GitHub's official [announcement of the npm v12 breaking changes](https://git
284
284
 
285
285
  ### Precompiled artifacts
286
286
 
287
- The [install script](https://github.com/uhop/install-artifact-from-github/blob/master/bin/install-from-cache.js) attempts to download a prebuilt artifact from GitHub Releases. Override the download location with the `RE2_DOWNLOAD_MIRROR` environment variable.
287
+ The [install script](https://github.com/uhop/install-artifact-from-github/blob/master/bin/install-from-cache.js) attempts to download a prebuilt artifact from GitHub Releases. A download from GitHub is [verified](https://github.com/uhop/install-artifact-from-github/wiki/Verifying-artifacts) against the SHA-256 hashes pinned in this package's `artifactHashes` field before it is used — a binary that is not byte-for-byte the one published is rejected. Override the download location with the `RE2_DOWNLOAD_MIRROR` environment variable (a mirror serves your own builds and is not hash-checked). To skip the download entirely and always build from source, set `RE2_DOWNLOAD_FORCE_BUILD` to a non-empty value.
288
288
 
289
- If the download fails, the script builds RE2 locally using [node-gyp](https://github.com/nodejs/node-gyp).
289
+ If the download fails or is rejected, the script builds RE2 locally using [node-gyp](https://github.com/nodejs/node-gyp).
290
290
 
291
291
  ## How to use
292
292
 
@@ -436,6 +436,7 @@ Tables are baked in at build time from Unicode 17.0. To target a newer Unicode v
436
436
 
437
437
  ## Release history
438
438
 
439
+ - 1.26.0 *Verified prebuilt downloads. Thx, [ataberk-xyz](https://github.com/ataberk-xyz).*
439
440
  - 1.25.2 *Two DoS security fixes: a global `match()` with an empty-matchable pattern (`a*`, `(?:)`, …) no longer loops forever exhausting memory (GHSA-6hxr-mr5r-9836), and an out-of-range `lastIndex` on a non-ASCII subject no longer reads past the buffer and crashes (GHSA-ff84-5f28-78qj). Both now match the built-in engine. Thx, [ataberk-xyz](https://github.com/ataberk-xyz).*
440
441
  - 1.25.1 *Security fix (GHSA-8hcv-x26h-mcgp): a global `replace()` using an output-amplifying template (`$'` or `` $` ``) on very large input could exceed V8's maximum string length and abort the whole process. It now throws a catchable `RangeError`, matching the built-in engine. Thx, [ataberk-xyz](https://github.com/ataberk-xyz).*
441
442
  - 1.25.0 *Full Unicode 17.0.0 property classes (Fixes #226). New `maxMem` option for `RE2.Set`. Faster matching on pure-ASCII inputs. Narrowed Node support — drops Node 25.x and older patch releases.*
package/llms-full.txt CHANGED
@@ -18,7 +18,7 @@
18
18
  npm install re2
19
19
  ```
20
20
 
21
- Prebuilt native binaries are downloaded automatically. Falls back to building from source via node-gyp if no prebuilt is available.
21
+ Prebuilt native binaries are downloaded automatically and verified against SHA-256 hashes pinned in re2's `package.json` (`artifactHashes`). Falls back to building from source via node-gyp if no prebuilt is available or verification fails. Set `RE2_DOWNLOAD_FORCE_BUILD` to a non-empty value to always build from source.
22
22
 
23
23
  Both paths run in re2's install script. Under npm 12+ defaults (July 2026), install scripts require approval in the consuming project's `package.json`: run `npm pkg set allowScripts.re2=true --json` before `npm install re2`, otherwise the install fails with `ESTRICTALLOWSCRIPTS`. npm 11.16+ runs the script but prints a warning until approved.
24
24
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "re2",
3
- "version": "1.25.2",
3
+ "version": "1.26.0",
4
4
  "description": "Bindings for RE2: fast, safe alternative to backtracking regular expression engines.",
5
5
  "homepage": "https://github.com/uhop/node-re2",
6
6
  "bugs": "https://github.com/uhop/node-re2/issues",
@@ -17,7 +17,7 @@
17
17
  "vendor"
18
18
  ],
19
19
  "dependencies": {
20
- "install-artifact-from-github": "^1.6.0",
20
+ "install-artifact-from-github": "^1.7.0",
21
21
  "nan": "^2.27.0",
22
22
  "node-gyp": "^13.0.0"
23
23
  },
@@ -35,7 +35,8 @@
35
35
  "test:seq": "tape6-seq --flags FO",
36
36
  "test:proc": "tape6-proc --flags FO",
37
37
  "save-to-github": "save-to-github-cache --artifact build/Release/re2.node",
38
- "install": "install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR --skip-path-var RE2_DOWNLOAD_SKIP_PATH --skip-ver-var RE2_DOWNLOAD_SKIP_VER || node-gyp -j max rebuild",
38
+ "prepublishOnly": "hash-github-cache --write",
39
+ "install": "install-from-cache --artifact build/Release/re2.node --host-var RE2_DOWNLOAD_MIRROR --skip-path-var RE2_DOWNLOAD_SKIP_PATH --skip-ver-var RE2_DOWNLOAD_SKIP_VER --force-build-var RE2_DOWNLOAD_FORCE_BUILD || node-gyp -j max rebuild",
39
40
  "verify-build": "node scripts/verify-build.js",
40
41
  "build:dev": "node-gyp -j max build --debug",
41
42
  "build": "node-gyp -j max build",
@@ -71,5 +72,31 @@
71
72
  "/tests/test-*.*js",
72
73
  "/tests/test-*.*ts"
73
74
  ]
75
+ },
76
+ "artifactHashes": {
77
+ "darwin-arm64-127": "sha256:ee6ab29e4827d1373145cfb75ef16584fa62aa4231f4d0cb6563d8f17e9562ba",
78
+ "darwin-arm64-137": "sha256:1c7092bd5b422c40f54c3d7dc34f5907285a0cd44ff4d638b862d84754d28147",
79
+ "darwin-arm64-147": "sha256:7e0ed56cc8c9041ba01227c3cb6baa976eaf5fd6f7eaf78064dcdd22b0e2e13d",
80
+ "darwin-x64-127": "sha256:2eff49ac19346b316fc19d6d99752eefac50a68d52882f9b449ee75937f7ef11",
81
+ "darwin-x64-137": "sha256:a034c96ec3bff397bc5e5f629f0c79f72c42aac91e3c234424d09ec2ba6d55f0",
82
+ "darwin-x64-147": "sha256:1772726792f2171a77bf5b5186612ce58a36be349cc6e5191986cd66925bbd65",
83
+ "linux-arm64-127": "sha256:11953057e63ba205c1d27b4145955c4f671d5b086bb98f7a2309c689639c8533",
84
+ "linux-arm64-137": "sha256:3b3920e2cce296fc75f9e1a3a70940d1ed9858ffc525aae03a897e61e75bba87",
85
+ "linux-arm64-147": "sha256:94938e8a5f9cbcd4ecde45d6b29fc526a19b2db1e8e7fb3aa280a4a58fc1bf0e",
86
+ "linux-musl-arm64-127": "sha256:51125be7c782612e89ed07cf3b695e7de63953c272f51be321ecbf170c258389",
87
+ "linux-musl-arm64-137": "sha256:34c78f56c986a0b2eff017dd173c5280531df70512dbec0cd33915c01ad42cd1",
88
+ "linux-musl-arm64-147": "sha256:fbf80ece0901a242191d9d26a18664cad8ba9785e141990deb04e6efc8665af3",
89
+ "linux-musl-x64-127": "sha256:569cc2d01e26e299a0f3d719f67603442e8e2045315ca2cac995504c1480fe99",
90
+ "linux-musl-x64-137": "sha256:89991ff4439e93b27539c0d81c17d05e5752814996464c835d2c646e785cecea",
91
+ "linux-musl-x64-147": "sha256:121e9d5f7af6f75b4a1d2b3bab514f514c7d93101e8eb992bd3e9fb2765f857d",
92
+ "linux-x64-127": "sha256:3218e8a6daba6d70e525668c76d9a955d383c45266e49c52fb716828e9bf1771",
93
+ "linux-x64-137": "sha256:a0a0e9a261625f7a982851d3f069dd7f3a370399f5be90b1922835ac6bf66be8",
94
+ "linux-x64-147": "sha256:140286223194fe98650a72da7de8f893cd51b72f607c401f62d7d5c860e2e992",
95
+ "win32-arm64-127": "sha256:cb763db7c2a21ac4557946df9b0239a3e51db8b7fca7adb7d74adb4317e846b7",
96
+ "win32-arm64-137": "sha256:469db40cd5ad51f16652d3d122e37ea4e448dd43691cd3f935905e462f0634df",
97
+ "win32-arm64-147": "sha256:8c9505f8e0a85c437163bbbc10556e8fa4938d03dba063d4516ae34301f46020",
98
+ "win32-x64-127": "sha256:c97d9a0ab350720a01e367d62956b5f85d645613fcb71b5047b41a1806f6d609",
99
+ "win32-x64-137": "sha256:0d729f3b2e965fad8c1cec2f16dd8b4adcc7d55b80580d3ec96b5a56ef0c443b",
100
+ "win32-x64-147": "sha256:425fa904163218fd1f96692838a04955b3fd148604c4e455dc8a17527e5c6717"
74
101
  }
75
102
  }