diff --git a/.editorconfig b/.editorconfig index b50059bb..cef4cab0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -12,3 +12,7 @@ indent_size = 4 [{package.json,.travis.yml,nightwatch.json}] indent_style = space indent_size = 2 + +[.github/**.yml] +indent_style = space +indent_size = 2 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 54694136..fd48e42e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -43,7 +43,7 @@ updates: # Assignees assignees: - - "${{ github.repository_owner }}" + - "mkilijanek" # Reviewers (customize as needed) # reviewers: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ff3c2b41..2579728e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -5,12 +5,10 @@ on: branches: - main - master - - develop pull_request: branches: - main - master - - develop schedule: # Run at 4 AM UTC every Monday - cron: '0 4 * * 1' diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml index 31d58583..b91b1ae0 100644 --- a/.github/workflows/dependency-review.yml +++ b/.github/workflows/dependency-review.yml @@ -5,7 +5,6 @@ on: branches: - main - master - - develop paths: - 'package.json' - 'package-lock.json' @@ -44,7 +43,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '18' + node-version: 24 cache: 'npm' - name: Install dependencies diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index f31dc3c9..bbd363ba 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -2,129 +2,64 @@ name: "Master Build, Test & Deploy" on: workflow_dispatch: - inputs: - nightly: - description: "Tag build as nightly" - required: false - default: "false" push: branches: - - master - schedule: - # Weekly build and publish to keep images fresh - - cron: '0 3 * * 1' + - master -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - PLATFORMS: linux/amd64,linux/arm64 - -env: - REGISTRY: ghcr.io - IMAGE_NAME: ${{ github.repository }} - PLATFORMS: linux/amd64,linux/arm64 +permissions: + contents: read jobs: main: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - - name: Set node version - uses: actions/setup-node@v3 - with: - node-version: '18.x' - - - name: Install - run: | - export DETECT_CHROMEDRIVER_VERSION=true - npm install - npm run setheapsize - - - name: Lint - run: npx grunt lint - - - name: Unit Tests - run: | - npm test - npm run testnodeconsumer - - - name: Production Build - if: success() - run: npx grunt prod --msg="Version 10 is here! Read about the new features here" - - - name: Generate sitemap - run: npx grunt exec:sitemap - - - name: UI Tests - if: success() - run: | - sudo apt-get install xvfb - xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui - - - name: Prepare for GitHub Pages - if: success() - run: npx grunt copy:ghPages - - - name: Deploy to GitHub Pages - if: success() && github.ref == 'refs/heads/master' - uses: crazy-max/ghaction-github-pages@v3 - with: - target_branch: gh-pages - build_dir: ./build/prod - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - docker-images: - name: Build & Publish Docker Images - runs-on: ubuntu-latest - needs: main - if: github.ref == 'refs/heads/master' permissions: - contents: read - packages: write + contents: write + pages: write + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - name: Set node version + uses: actions/setup-node@v4 + with: + node-version: 24 + registry-url: "https://registry.npmjs.org" - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Install + run: | + export DETECT_CHROMEDRIVER_VERSION=true + npm install + npm run setheapsize - - name: Log in to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Lint + run: npx grunt lint - - name: Set extra tags - run: | - if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.nightly }}" = "true" ]; then - echo "EXTRA_TAGS=type=raw,value=nightly" >> $GITHUB_ENV - else - echo "EXTRA_TAGS=" >> $GITHUB_ENV - fi + - name: Unit Tests + run: | + npm test + npm run testnodeconsumer - - name: Docker metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=raw,value=latest - type=sha,format=long - ${{ env.EXTRA_TAGS }} + - name: Production Build + if: success() + run: npx grunt prod --msg="" - - name: Build and push multi-arch image - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - platforms: ${{ env.PLATFORMS }} - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max + - name: Generate sitemap + run: npx grunt exec:sitemap + + - name: UI Tests + if: success() + run: | + sudo apt-get install xvfb + xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + + - name: Prepare for GitHub Pages + if: success() + run: npx grunt copy:ghPages + + - name: Deploy to GitHub Pages + if: success() && github.ref == 'refs/heads/master' + uses: crazy-max/ghaction-github-pages@v3 + with: + target_branch: gh-pages + build_dir: ./build/prod + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index 296e60b9..10d4e725 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -1,5 +1,8 @@ name: "Pull Requests" +permissions: + contents: read + on: workflow_dispatch: pull_request: @@ -9,47 +12,50 @@ jobs: main: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Set node version - uses: actions/setup-node@v3 - with: - node-version: '18.x' + - name: Set node version + uses: actions/setup-node@v4 + with: + node-version: 24 + registry-url: "https://registry.npmjs.org" - - name: Install - run: | - export DETECT_CHROMEDRIVER_VERSION=true - npm install - npm run setheapsize + - name: Install + run: | + export DETECT_CHROMEDRIVER_VERSION=true + npm install + npm run setheapsize - - name: Lint - run: npx grunt lint + - name: Lint + run: npx grunt lint - - name: Unit Tests - run: | - npm test - npm run testnodeconsumer + - name: Unit Tests + run: | + npm test + npm run testnodeconsumer - - name: Production Build - if: success() - run: npx grunt prod + - name: Production Build + if: success() + run: npx grunt prod - - name: Production Image Build - if: success() - id: build-image - uses: redhat-actions/buildah-build@v2 - with: - # Not being uploaded to any registry, use a simple name to allow Buildah to build correctly. - image: cyberchef - containerfiles: ./Dockerfile - platforms: linux/amd64 - oci: true - # Webpack seems to use a lot of open files, increase the max open file limit to accomodate. - extra-args: | - --ulimit nofile=10000 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: UI Tests - if: success() - run: | - sudo apt-get install xvfb - xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Production Image Build + if: success() + id: build-image + uses: docker/build-push-action@v6 + with: + context: . + push: false + tags: cyberchef:pr + platforms: linux/amd64,linux/arm64 + + - name: UI Tests + if: success() + run: | + sudo apt-get install xvfb + xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index a77f4984..c3e6b7e4 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -4,7 +4,10 @@ on: workflow_dispatch: push: tags: - - 'v*' + - "v*" + +permissions: + contents: read env: REGISTRY: ghcr.io @@ -14,83 +17,110 @@ env: jobs: main: + permissions: + packages: write + contents: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Set node version - uses: actions/setup-node@v3 - with: - node-version: '18.x' + - name: Set node version + uses: actions/setup-node@v4 + with: + node-version: 24 + registry-url: "https://registry.npmjs.org" - - name: Install - run: | - export DETECT_CHROMEDRIVER_VERSION=true - npm ci - npm run setheapsize + - name: Install + run: | + export DETECT_CHROMEDRIVER_VERSION=true + npm ci + npm run setheapsize - - name: Lint - run: npx grunt lint + - name: Lint + run: npx grunt lint - - name: Unit Tests - run: | - npm test - npm run testnodeconsumer + - name: Unit Tests + run: | + npm test + npm run testnodeconsumer - - name: Production Build - run: npx grunt prod + - name: Production Build + run: npx grunt prod - - name: UI Tests - run: | - sudo apt-get install xvfb - xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + - name: UI Tests + run: | + sudo apt-get install xvfb + xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui - - name: Image Metadata - id: image-metadata - uses: docker/metadata-action@v4 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - tags: | - type=semver,pattern={{major}} - type=semver,pattern={{major}}.{{minor}} - type=semver,pattern={{version}} + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Production Image Build - id: build-image - uses: redhat-actions/buildah-build@v2 - with: - tags: ${{ steps.image-metadata.outputs.tags }} - labels: ${{ steps.image-metadata.outputs.labels }} - containerfiles: ./Dockerfile - platforms: linux/amd64,linux/arm64 - oci: true - # enable build layer caching between platforms - layers: true - # Webpack seems to use a lot of open files, increase the max open file limit to accomodate. - extra-args: | - --ulimit nofile=10000 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - - name: Publish to GHCR - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build-image.outputs.image }} - tags: ${{ steps.build-image.outputs.tags }} - registry: ${{ env.REGISTRY }} - username: ${{ env.REGISTRY_USER }} - password: ${{ env.REGISTRY_PASSWORD }} + - name: Image Metadata + id: image-metadata + uses: docker/metadata-action@v4 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + tags: | + type=semver,pattern={{major}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{version}} - - name: Upload Release Assets - id: upload-release-assets - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/prod/*.zip - tag: ${{ github.ref }} - overwrite: true - file_glob: true - body: "See the [CHANGELOG](https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md) and [commit messages](https://github.com/gchq/CyberChef/commits/master) for details." + - name: Log in to GHCR + uses: docker/login-action@v3 + with: + registry: ${{ env.REGISTRY }} + username: ${{ env.REGISTRY_USER }} + password: ${{ env.REGISTRY_PASSWORD }} - - name: Publish to NPM - uses: JS-DevTools/npm-publish@v1 - with: - token: ${{ secrets.NPM_TOKEN }} + - name: Publish to GHCR + uses: docker/build-push-action@v6 + with: + context: . + push: true + tags: ${{ steps.image-metadata.outputs.tags }} + labels: ${{ steps.image-metadata.outputs.labels }} + platforms: linux/amd64,linux/arm64 + + - name: Upload Release Assets + id: upload-release-assets + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: build/prod/*.zip + tag: ${{ github.ref }} + overwrite: true + file_glob: true + body: "See the [CHANGELOG](https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md) and [commit messages](https://github.com/gchq/CyberChef/commits/master) for details." + + npm-publish: + permissions: + id-token: write + contents: read + needs: main + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set node version + uses: actions/setup-node@v4 + with: + node-version: 24 + registry-url: "https://registry.npmjs.org" + + - name: Install + run: npm ci + + - name: Create machine generated files + run: npm run node + + - name: Reset node version ready for publish + uses: actions/setup-node@v4 + with: + node-version: 24 + registry-url: "https://registry.npmjs.org" + + - name: Publish to NPM + run: npm publish diff --git a/.github/workflows/security-auto-fix.yml b/.github/workflows/security-auto-fix.yml index 4063e924..2027af2c 100644 --- a/.github/workflows/security-auto-fix.yml +++ b/.github/workflows/security-auto-fix.yml @@ -44,7 +44,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '18' + node-version: 24 cache: 'npm' - name: Cache node modules diff --git a/CHANGELOG.md b/CHANGELOG.md index d3a8feb7..960e922b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,104 @@ All major and minor version changes will be documented in this file. Details of ## Details +### [10.22.0] - 2026-02-11 +- Separate npm publish out into separate job and run with Node 24.5 [@GCHQDeveloper581] | [#2188] +- Fixed Percent delimiter for hex encoding [@beneri] [@C85297] | [#2137] +- Added the ability to paste one or more Images from the Clipboard [@t-martine] [@a3957273] [@C85297] | [#1876] +- Quoted Printable - consistent reference to 'email' [@wesinator] | [#2186] +- Fix freeze when output text decoding fails [@Raka-loah] | [#1573] +- Update Browserslist DB [@C85297] | [#2183] +- Add contents write permission to releases workflow [@C85297] | [#2182] +- Fix release workflow permissions [@C85297] | [#2181] + +### [10.21.0] - 2026-02-05 +- Fix import operations with special chars in them [@d98762625] [@jg42526] | [#1040] +- Remove custom CodeQL workflow [@C85297] | [#2176] +- Fix code scanning warnings in workflows [@GCHQDeveloper581] | [#2177] +- Use NPM trusted publishing [@C85297] [@GCHQDeveloper581] | [#2174] +- Fix: Correctly parse xxd odd byte hexdumps [@ThomasNotTom] [@GCHQDeveloper581] | [#2058] +- Update Sitemap URLs to Use Valid Paths in sitemap.mjs [@rbpi] [@C85297] | [#1861] +- Use recommended GitHub Actions to build image [@AlexGustafsson] [@C85297] | [#2055] +- Remove version 10 message from banner [@C85297] | [#2169] +- Bump form-data from 4.0.1 to 4.0.5 | [#2175] +- Bump node-forge from 1.3.1 to 1.3.3 | [#2173] +- Update crypto browserify [@C85297] | [#2172] +- Update kbpgp package (resolves #2135) [@GCHQDeveloper581] | [#2136] +- Fix the processing of ALPNs for JA4 to align with new specification update [@tuliperis] | [#2165] +- Add Bech32 and Bech32m encoding/decoding operations [@thomasxm] | [#2159] +- Exclude Delete character from hex dump output [@mikecat] [@C85297] | [#2086] +- Tiny typo fix in "To Base85" operation [@twostraws] | [#2118] +- Bump jsonpath-plus [@C85297] | [#2166] + +### [10.20.0] - 2026-01-28 +- Fixed Optical Character Recognition and added tests [@n1474335] | [ab37c1e] +- Fixed JA4 version fallback value [@n1474335] | [7a5225c] +- Updated chromedriver [@n1474335] | [0e82e4b] +- Fixed RSA Sign and Verify character encodings [@n1474335] | [895a929] +- Updated chromedriver [@n1474335] | [d3adfc7] +- Added message format arg to RSA Verify operation [@n1474335] | [47c85a1] +- Add operation for parsing X.509 CRLs [@robinsandhu] | [#1887] +- Fix typo in description of JWT Sign recipe [@GuilhermoReadonly] | [#1961] +- Corrected path to generateNodeIndex.mjs [@simonarnell] | [#1959] +- Add 'header' ingredient to JWT Sign operation [@RandomByte] | [#1957] +- Add Parse TLS record operation [@c65722] | [#1936] +- Automatically detect chrome driver version [@gchq] | [#1972] +- Add Strip UDP header operation [@c65722] | [#1900] +- Add Strip TCP header operation [@c65722] | [#1898] +- Webpack compress with gzip and brotli [@max0x53] | [#1955] +- add offset field to 'Add Line Numbers' operation [@Adamkadaban] | [#1866] +- Disable flakey URL test [@a3957273] | [#1973] +- Add Strip IPv4 header operation [@c65722] | [#1899] +- IPv6 Transition Operation [@jb30795] | [#1780] +- fix: Blowfish - ignore IV length in ECB mode [@FranciscoPombal] | [#1902] +- Add 'Drop nth bytes' operation [@Oshawk] | [#1914] +- Add 'Take nth bytes' operation [@Oshawk] | [#1915] +- Add Leet Speak [@bartblaze] | [#1971] +- Fix Generate TOTP & HOPT [@exactlyaron] | [#1966] +- Updated luhn checksum operation to work with different bases [@k3ach] | [#1933] +- automatically theme mode based on user preference [@vs4vijay] | [#1921] +- fix: DES/Triple DES - misleading error messages [@FranciscoPombal] | [#1904] +- fix: ROT13 - shifting numbers by negative amounts [@FranciscoPombal] | [#1903] +- Introduce Yubico's Modhex for Conversion [@linuxgemini] | [#1105] +- Feature: MIME RFC2047 Decoding [@MShwed] | [#630] +- CC-1889 add _ option [@depperm] | [#1977] +- chore(root): add cspell [@evenstensberg] | [#1976] +- Preserve uppercase for Leet Speak [@bartblaze] | [#1981] +- Load the user's preferred color scheme if the URL contains an invalid theme [@0xh3xa] | [#2007] +- Add SM2 Encrypt and Decrypt Operations [@flakjacket95] | [#1909] +- Support jq as an operation. [@zhzy0077] | [#1604] +- Add fingerprints to the 'Parse X.509 certificate' operation [@JSCU-CNI] | [#1863] +- Added a JSON to YAML and a YAML to JSON operation [@ccarpo] | [#1286] +- Add CRC Operation [@r4mos] | [#1993] +- Bug Fix: selected theme not loading when refreshing [@0xh3xa] | [#2006] +- Fix(RecipeWaiter): sanitize user input in addOperation to prevent XSS [@0xh3xa] | [#2014] +- Docker multiplatform build support [@PathToLife] | [#1974] +- Add Base32 Hex Extended Alphabet and Base32 Tests. [@peterc-s] | [#1991] +- Add ECB/NoPadding and CBC/NoPadding support to AES encryption [@plvie] | [#2013] +- Add new operation: PHP Serialize [@brun0ne] | [#1548] +- Push input through postmessage [@kenduguay1] | [#1992] +- Add jsonata query operation [@jonking-ajar] | [#1587] +- Re-enable Npm Release in github workflows [@PathToLife] | [#2031] +- Add to ECDSA Verify the message format [@r4mos] | [#2027] +- Added alternating caps functionality [@sw5678] | [#1897] +- XOR Checksum operation added [@jg42526] | [#2035] +- Add GenerateAllChecksums operation * Remove checksums from GenerateAllHashes operation [@es45411] | [66d445c] +- Update GenerateAllChecksums infoURL [@es45411] | [#2037] +- Add toggle "+" character to URLDecode operation [@es45411] | [#2040] +- Workaround for Safari load bug [@GCHQDeveloper94872] | [#2038] +- Updated Dockerfile to correctly build on ARM64 platforms [@Sma-Das] | [#2042] +- Addresses bug report #2008 Added explicit support for octal IP addresses. Changed approach to IPv4 regex to be string manipulation generated. Added some unit tests for IP address parsing - probably not full coverage. Added lookahead and lookbehind tricks to resolve warned issue that 1.2.3.256 would still be extracted as 1.2.3.25. Now only accepts valid IP addresses. Warning replaced with clause about infinite length dotted decimal forms. [@gchqdev364] | [#2041] +- Remove trim from rail fence [@Odyhibit] | [#1986] +- Fix email regex [@ericli-splunk] | [#2025] +- Add Blake3 hashing [@xumptex] | [#2023] +- Use defaultIndex instead of 0 in transformArgs [@bartvanandel] | [#2015] +- Add "Generate UUID" and "Analyse UUID" operations [@bartvanandel] | [#2011] +- Add new operation: Template [@kendallgoto] | [#2021] +- Add more clear build instructions [@remingtr] | [#1873] +- Show On Map updated to use leaflet over WikiMedia [@0xff1ce] | [#1884] +- Fixed ToDecimal signed logic [@starplanet] | [#1545] +- Use BigInt for encoding/decoding VarInt [@mikecat] | [#1978] + ### [10.19.0] - 2024-06-21 - Add support for ECDSA and DSA in 'Parse CSR' [@robinsandhu] | [#1828] - Fix typos in SIGABA.mjs [@eltociear] | [#1834] @@ -440,6 +538,9 @@ All major and minor version changes will be documented in this file. Details of ## [4.0.0] - 2016-11-28 - Initial open source commit [@n1474335] | [b1d73a72](https://github.com/gchq/CyberChef/commit/b1d73a725dc7ab9fb7eb789296efd2b7e4b08306) +[10.22.0]: https://github.com/gchq/CyberChef/releases/tag/v10.22.0 +[10.21.0]: https://github.com/gchq/CyberChef/releases/tag/v10.21.0 +[10.20.0]: https://github.com/gchq/CyberChef/releases/tag/v10.20.0 [10.19.0]: https://github.com/gchq/CyberChef/releases/tag/v10.19.0 [10.18.0]: https://github.com/gchq/CyberChef/releases/tag/v10.18.0 [10.17.0]: https://github.com/gchq/CyberChef/releases/tag/v10.17.0 @@ -630,6 +731,72 @@ All major and minor version changes will be documented in this file. Details of [@cplussharp]: https://github.com/cplussharp [@robinsandhu]: https://github.com/robinsandhu [@eltociear]: https://github.com/eltociear +[@GuilhermoReadonly]: https://github.com/GuilhermoReadonly +[@simonarnell]: https://github.com/simonarnell +[@RandomByte]: https://github.com/RandomByte +[@c65722]: https://github.com/c65722 +[@c65722]: https://github.com/c65722 +[@c65722]: https://github.com/c65722 +[@max0x53]: https://github.com/max0x53 +[@Adamkadaban]: https://github.com/Adamkadaban +[@c65722]: https://github.com/c65722 +[@jb30795]: https://github.com/jb30795 +[@FranciscoPombal]: https://github.com/FranciscoPombal +[@Oshawk]: https://github.com/Oshawk +[@Oshawk]: https://github.com/Oshawk +[@bartblaze]: https://github.com/bartblaze +[@exactlyaron]: https://github.com/exactlyaron +[@k3ach]: https://github.com/k3ach +[@vs4vijay]: https://github.com/vs4vijay +[@FranciscoPombal]: https://github.com/FranciscoPombal +[@FranciscoPombal]: https://github.com/FranciscoPombal +[@linuxgemini]: https://github.com/linuxgemini +[@depperm]: https://github.com/depperm +[@evenstensberg]: https://github.com/evenstensberg +[@bartblaze]: https://github.com/bartblaze +[@0xh3xa]: https://github.com/0xh3xa +[@flakjacket95]: https://github.com/flakjacket95 +[@zhzy0077]: https://github.com/zhzy0077 +[@JSCU-CNI]: https://github.com/JSCU-CNI +[@ccarpo]: https://github.com/ccarpo +[@r4mos]: https://github.com/r4mos +[@0xh3xa]: https://github.com/0xh3xa +[@0xh3xa]: https://github.com/0xh3xa +[@PathToLife]: https://github.com/PathToLife +[@peterc-s]: https://github.com/peterc-s +[@plvie]: https://github.com/plvie +[@kenduguay1]: https://github.com/kenduguay1 +[@jonking-ajar]: https://github.com/jonking-ajar +[@PathToLife]: https://github.com/PathToLife +[@r4mos]: https://github.com/r4mos +[@jg42526]: https://github.com/jg42526 +[@es45411]: https://github.com/es45411 +[@gchq]: https://github.com/gchq +[@gchqdev364]: https://github.com/gchqdev364 +[@GCHQDeveloper94872]: https://github.com/GCHQDeveloper94872 +[@Sma-Das]: https://github.com/Sma-Das +[@gchq]: https://github.com/gchq +[@Odyhibit]: https://github.com/Odyhibit +[@ericli-splunk]: https://github.com/ericli-splunk +[@xumptex]: https://github.com/xumptex +[@bartvanandel]: https://github.com/bartvanandel +[@bartvanandel]: https://github.com/bartvanandel +[@kendallgoto]: https://github.com/kendallgoto +[@remingtr]: https://github.com/remingtr +[@0xff1ce]: https://github.com/0xff1ce +[@starplanet]: https://github.com/starplanet +[@C85297]: https://github.com/C85297 +[@GCHQDeveloper581]: https://github.com/GCHQDeveloper581 +[@ThomasNotTom]: https://github.com/ThomasNotTom +[@rbpi]: https://github.com/rbpi +[@AlexGustafsson]: https://github.com/AlexGustafsson +[@tuliperis]: https://github.com/tuliperis +[@thomasxm]: https://github.com/thomasxm +[@twostraws]: https://github.com/twostraws +[@beneri]: https://github.com/beneri +[@t-martine]: https://github.com/t-martine +[@wesinator]: https://github.com/wesinator +[@Raka-loah]: https://github.com/Raka-loah [8ad18b]: https://github.com/gchq/CyberChef/commit/8ad18bc7db6d9ff184ba3518686293a7685bf7b7 @@ -642,6 +809,46 @@ All major and minor version changes will be documented in this file. Details of [760eff4]: https://github.com/gchq/CyberChef/commit/760eff49b5307aaa3104c5e5b437ffe62299acd1 [65ffd8d]: https://github.com/gchq/CyberChef/commit/65ffd8d65d88eb369f6f61a5d1d0f807179bffb7 [0a353ee]: https://github.com/gchq/CyberChef/commit/0a353eeb378b9ca5d49e23c7dfc175ae07107b08 +[66d445c]: https://github.com/gchq/CyberChef/commit/66d445c5ef4e8bd896fd15396e3ce2d660d8ace1 +[ab37c1e]: https://github.com/gchq/CyberChef/commit/ab37c1e562dbee0495ed32876ecbb8225282af25 +[965570d]: https://github.com/gchq/CyberChef/commit/965570d2504c17ee1f96211a1dc10ed40cd2b332 +[a477f47]: https://github.com/gchq/CyberChef/commit/a477f47aecd01d78b11fe186ed4b20d9c487cfac +[7a5225c]: https://github.com/gchq/CyberChef/commit/7a5225c961a5e0d192b03152117cd10a761f73d6 +[5f88ae4]: https://github.com/gchq/CyberChef/commit/5f88ae44ec77228d9bed8f11e8cc8e7dcfb36914 +[0e82e4b]: https://github.com/gchq/CyberChef/commit/0e82e4b7c6c77cadb8be61cb145e081d6ecfdc88 +[d635cca]: https://github.com/gchq/CyberChef/commit/d635cca2106aae2a59caf0e5d7e3633ee1ea3155 +[895a929]: https://github.com/gchq/CyberChef/commit/895a9299255525cb57886deb9d9fd4ba17ae9548 +[270a333]: https://github.com/gchq/CyberChef/commit/270a33317944612d27ea1cc15275ad6b0ed097e5 +[d3adfc7]: https://github.com/gchq/CyberChef/commit/d3adfc7c3e5719279524356bce5261bd8350c0f8 +[47c85a1]: https://github.com/gchq/CyberChef/commit/47c85a105ddbdd4cabfa44ddddbc56e3907a8c33 +[3822c6c]: https://github.com/gchq/CyberChef/commit/3822c6c520a0b4200abc675c33f46082f5b9efc6 +[66d445c]: https://github.com/gchq/CyberChef/commit/66d445c5ef4e8bd896fd15396e3ce2d660d8ace1 +[ab37c1e]: https://github.com/gchq/CyberChef/commit/ab37c1e562dbee0495ed32876ecbb8225282af25 +[965570d]: https://github.com/gchq/CyberChef/commit/965570d2504c17ee1f96211a1dc10ed40cd2b332 +[a477f47]: https://github.com/gchq/CyberChef/commit/a477f47aecd01d78b11fe186ed4b20d9c487cfac +[7a5225c]: https://github.com/gchq/CyberChef/commit/7a5225c961a5e0d192b03152117cd10a761f73d6 +[5f88ae4]: https://github.com/gchq/CyberChef/commit/5f88ae44ec77228d9bed8f11e8cc8e7dcfb36914 +[0e82e4b]: https://github.com/gchq/CyberChef/commit/0e82e4b7c6c77cadb8be61cb145e081d6ecfdc88 +[d635cca]: https://github.com/gchq/CyberChef/commit/d635cca2106aae2a59caf0e5d7e3633ee1ea3155 +[895a929]: https://github.com/gchq/CyberChef/commit/895a9299255525cb57886deb9d9fd4ba17ae9548 +[270a333]: https://github.com/gchq/CyberChef/commit/270a33317944612d27ea1cc15275ad6b0ed097e5 +[d3adfc7]: https://github.com/gchq/CyberChef/commit/d3adfc7c3e5719279524356bce5261bd8350c0f8 +[47c85a1]: https://github.com/gchq/CyberChef/commit/47c85a105ddbdd4cabfa44ddddbc56e3907a8c33 +[3822c6c]: https://github.com/gchq/CyberChef/commit/3822c6c520a0b4200abc675c33f46082f5b9efc6 +[66d445c]: https://github.com/gchq/CyberChef/commit/66d445c5ef4e8bd896fd15396e3ce2d660d8ace1 +[ab37c1e]: https://github.com/gchq/CyberChef/commit/ab37c1e562dbee0495ed32876ecbb8225282af25 +[965570d]: https://github.com/gchq/CyberChef/commit/965570d2504c17ee1f96211a1dc10ed40cd2b332 +[a477f47]: https://github.com/gchq/CyberChef/commit/a477f47aecd01d78b11fe186ed4b20d9c487cfac +[7a5225c]: https://github.com/gchq/CyberChef/commit/7a5225c961a5e0d192b03152117cd10a761f73d6 +[5f88ae4]: https://github.com/gchq/CyberChef/commit/5f88ae44ec77228d9bed8f11e8cc8e7dcfb36914 +[0e82e4b]: https://github.com/gchq/CyberChef/commit/0e82e4b7c6c77cadb8be61cb145e081d6ecfdc88 +[d635cca]: https://github.com/gchq/CyberChef/commit/d635cca2106aae2a59caf0e5d7e3633ee1ea3155 +[895a929]: https://github.com/gchq/CyberChef/commit/895a9299255525cb57886deb9d9fd4ba17ae9548 +[270a333]: https://github.com/gchq/CyberChef/commit/270a33317944612d27ea1cc15275ad6b0ed097e5 +[d3adfc7]: https://github.com/gchq/CyberChef/commit/d3adfc7c3e5719279524356bce5261bd8350c0f8 +[47c85a1]: https://github.com/gchq/CyberChef/commit/47c85a105ddbdd4cabfa44ddddbc56e3907a8c33 +[3822c6c]: https://github.com/gchq/CyberChef/commit/3822c6c520a0b4200abc675c33f46082f5b9efc6 +[66d445c]: https://github.com/gchq/CyberChef/commit/66d445c5ef4e8bd896fd15396e3ce2d660d8ace1 [#95]: https://github.com/gchq/CyberChef/pull/299 [#173]: https://github.com/gchq/CyberChef/pull/173 @@ -778,4 +985,29 @@ All major and minor version changes will be documented in this file. Details of [#512]: https://github.com/gchq/CyberChef/issues/512 [#1732]: https://github.com/gchq/CyberChef/issues/1732 [#1789]: https://github.com/gchq/CyberChef/issues/1789 +[#1040]: https://github.com/gchq/CyberChef/pull/1040 +[#2176]: https://github.com/gchq/CyberChef/pull/2176 +[#2177]: https://github.com/gchq/CyberChef/pull/2177 +[#2174]: https://github.com/gchq/CyberChef/pull/2174 +[#2058]: https://github.com/gchq/CyberChef/pull/2058 +[#1861]: https://github.com/gchq/CyberChef/pull/1861 +[#2055]: https://github.com/gchq/CyberChef/pull/2055 +[#2169]: https://github.com/gchq/CyberChef/pull/2169 +[#2175]: https://github.com/gchq/CyberChef/pull/2175 +[#2173]: https://github.com/gchq/CyberChef/pull/2173 +[#2172]: https://github.com/gchq/CyberChef/pull/2172 +[#2136]: https://github.com/gchq/CyberChef/pull/2136 +[#2165]: https://github.com/gchq/CyberChef/pull/2165 +[#2159]: https://github.com/gchq/CyberChef/pull/2159 +[#2086]: https://github.com/gchq/CyberChef/pull/2086 +[#2118]: https://github.com/gchq/CyberChef/pull/2118 +[#2166]: https://github.com/gchq/CyberChef/pull/2166 +[#2188]: https://github.com/gchq/CyberChef/pull/2188 +[#2137]: https://github.com/gchq/CyberChef/pull/2137 +[#1876]: https://github.com/gchq/CyberChef/pull/1876 +[#2186]: https://github.com/gchq/CyberChef/pull/2186 +[#1573]: https://github.com/gchq/CyberChef/pull/1573 +[#2183]: https://github.com/gchq/CyberChef/pull/2183 +[#2182]: https://github.com/gchq/CyberChef/pull/2182 +[#2181]: https://github.com/gchq/CyberChef/pull/2181 diff --git a/CyberChef_backport_changes-10.22.1.txt b/CyberChef_backport_changes-10.22.1.txt new file mode 100644 index 00000000..ed42087f --- /dev/null +++ b/CyberChef_backport_changes-10.22.1.txt @@ -0,0 +1,5755 @@ +CHANGED: .editorconfig — mkilijanek/.editorconfig +++ gchq/.editorconfig +@@ -12,3 +12,7 @@ [{package.json,.travis.yml,nightwatch.json}] + +indent_style = space + +indent_size = 2 + +- + ++[.github/**.yml] + ++indent_style = space + ++indent_size = 2 + +REMOVED in gchq (exists in mkilijanek): .github/dependabot.yml REMOVED +in gchq (exists in mkilijanek): .github/workflows/codeql-analysis.yml +REMOVED in gchq (exists in mkilijanek): .github/workflows/codeql.yml +REMOVED in gchq (exists in mkilijanek): +.github/workflows/dependency-review.yml + +CHANGED: .github/workflows/master.yml — +mkilijanek/.github/workflows/master.yml +++ +gchq/.github/workflows/master.yml @@ -2,129 +2,64 @@ + +on: + +workflow_dispatch: + +- inputs: + +- nightly: + +- description: "Tag build as nightly" + +- required: false + +- default: "false" + + push: + + branches: + +- - master + +- schedule: + +- Weekly build and publish to keep images fresh + +- - cron: ‘0 3 * * 1’ + +- - master + +-env: + +- REGISTRY: ghcr.io + +- IMAGE_NAME: ${{ github.repository }} + +- PLATFORMS: linux/amd64,linux/arm64 + +- + +-env: + +- REGISTRY: ghcr.io + +- IMAGE_NAME: ${{ github.repository }} + +- PLATFORMS: linux/amd64,linux/arm64 + ++permissions: + +- contents: read + +jobs: + +main: + +- permissions: + +- contents: write + +- pages: write + + runs-on: ubuntu-latest + + steps: + +- - uses: actions/checkout@v3 + +- - uses: actions/checkout@v6 + +- - name: Set node version + +- uses: actions/setup-node@v3 + +- with: + +- node-version: '18.x' + +- - name: Set node version + +- uses: actions/setup-node@v6 + +- with: + +- node-version: 18 + +- registry-url: "https://registry.npmjs.org" + +- - name: Install + +- run: | + +- export DETECT_CHROMEDRIVER_VERSION=true + +- npm install + +- npm run setheapsize + +- - name: Install + +- run: | + +- export DETECT_CHROMEDRIVER_VERSION=true + +- npm install + +- npm run setheapsize + +- - name: Lint + +- run: npx grunt lint + +- - name: Lint + +- run: npx grunt lint + +- - name: Unit Tests + +- run: | + +- npm test + +- npm run testnodeconsumer + +- - name: Unit Tests + +- run: | + +- npm test + +- npm run testnodeconsumer + +- - name: Production Build + +- if: success() + +- run: npx grunt prod --msg="Version 10 is here! Read about the new features here" + +- - name: Production Build + +- if: success() + +- run: npx grunt prod --msg="" + +- - name: Generate sitemap + +- run: npx grunt exec:sitemap + +- - name: Generate sitemap + +- run: npx grunt exec:sitemap + +- - name: UI Tests + +- if: success() + +- run: | + +- sudo apt-get install xvfb + +- xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + +- - name: UI Tests + +- if: success() + +- run: | + +- sudo apt-get install xvfb + +- xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + +- - name: Prepare for GitHub Pages + +- if: success() + +- run: npx grunt copy:ghPages + +- - name: Prepare for GitHub Pages + +- if: success() + +- run: npx grunt copy:ghPages + +- - name: Deploy to GitHub Pages + +- if: success() && github.ref == 'refs/heads/master' + +- uses: crazy-max/ghaction-github-pages@v3 + +- with: + +- target_branch: gh-pages + +- build_dir: ./build/prod + +- env: + +- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +- + +- docker-images: + +- name: Build & Publish Docker Images + +- runs-on: ubuntu-latest + +- needs: main + +- if: github.ref == ‘refs/heads/master’ + +- permissions: + +- contents: read + +- packages: write + +- steps: + +- - uses: actions/checkout@v4 + +- + +- - name: Set up QEMU + +- uses: docker/setup-qemu-action@v3 + +- + +- - name: Set up Docker Buildx + +- uses: docker/setup-buildx-action@v3 + +- + +- - name: Log in to GitHub Container Registry + +- uses: docker/login-action@v3 + +- with: + +- registry: ${{ env.REGISTRY }} + +- username: ${{ github.actor }} + +- password: ${{ secrets.GITHUB_TOKEN }} + +- + +- - name: Set extra tags + +- run: | + +- if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.nightly }}" = "true" ]; then + +- echo "EXTRA_TAGS=type=raw,value=nightly" >> $GITHUB_ENV + +- else + +- echo "EXTRA_TAGS=" >> $GITHUB_ENV + +- fi + +- + +- - name: Docker metadata + +- id: meta + +- uses: docker/metadata-action@v5 + +- with: + +- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + +- tags: | + +- type=raw,value=latest + +- type=sha,format=long + +- ${{ env.EXTRA_TAGS }} + +- + +- - name: Build and push multi-arch image + +- uses: docker/build-push-action@v5 + +- with: + +- context: . + +- file: ./Dockerfile + +- platforms: ${{ env.PLATFORMS }} + +- push: true + +- tags: ${{ steps.meta.outputs.tags }} + +- labels: ${{ steps.meta.outputs.labels }} + +- cache-from: type=gha + +- cache-to: type=gha,mode=max + +- - name: Deploy to GitHub Pages + +- if: success() && github.ref == 'refs/heads/master' + +- uses: crazy-max/ghaction-github-pages@v3 + +- with: + +- target_branch: gh-pages + +- build_dir: ./build/prod + +- env: + +- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +CHANGED: .github/workflows/pull_requests.yml — +mkilijanek/.github/workflows/pull_requests.yml +++ +gchq/.github/workflows/pull_requests.yml @@ -1,4 +1,7 @@ name: “Pull +Requests” + +- + ++permissions: + +- contents: read + +on: + +workflow_dispatch: + +@@ -9,47 +12,46 @@ main: + + runs-on: ubuntu-latest + + steps: + +- - uses: actions/checkout@v3 + +- - uses: actions/checkout@v6 + +- - name: Set node version + +- uses: actions/setup-node@v3 + +- with: + +- node-version: '18.x' + +- - name: Set node version + +- uses: actions/setup-node@v6 + +- with: + +- node-version: 18 + +- registry-url: "https://registry.npmjs.org" + +- - name: Install + +- run: | + +- export DETECT_CHROMEDRIVER_VERSION=true + +- npm install + +- npm run setheapsize + +- - name: Install + +- run: | + +- export DETECT_CHROMEDRIVER_VERSION=true + +- npm install + +- npm run setheapsize + +- - name: Lint + +- run: npx grunt lint + +- - name: Lint + +- run: npx grunt lint + +- - name: Unit Tests + +- run: | + +- npm test + +- npm run testnodeconsumer + +- - name: Unit Tests + +- run: | + +- npm test + +- npm run testnodeconsumer + +- - name: Production Build + +- if: success() + +- run: npx grunt prod + +- - name: Production Build + +- if: success() + +- run: npx grunt prod + +- - name: Production Image Build + +- if: success() + +- id: build-image + +- uses: redhat-actions/buildah-build@v2 + +- with: + +- # Not being uploaded to any registry, use a simple name to allow Buildah to build correctly. + +- image: cyberchef + +- containerfiles: ./Dockerfile + +- platforms: linux/amd64 + +- oci: true + +- # Webpack seems to use a lot of open files, increase the max open file limit to accomodate. + +- extra-args: | + +- --ulimit nofile=10000 + +- - name: Set up Docker Buildx + +- uses: docker/setup-buildx-action@v3 + +- - name: UI Tests + +- if: success() + +- run: | + +- sudo apt-get install xvfb + +- xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + +- - name: Set up QEMU + +- uses: docker/setup-qemu-action@v3 + +- + +- - name: Production Image Build + +- if: success() + +- id: build-image + +- uses: docker/build-push-action@v6 + +- with: + +- platforms: linux/amd64,linux/arm64 + +- - name: UI Tests + +- if: success() + +- run: | + +- sudo apt-get install xvfb + +- xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + +CHANGED: .github/workflows/releases.yml — +mkilijanek/.github/workflows/releases.yml +++ +gchq/.github/workflows/releases.yml @@ -4,7 +4,10 @@ workflow_dispatch: + +push: + + tags: + +- - ’v*’ + +- - "v*" + +- + ++permissions: + +- contents: read + +env: + +REGISTRY: ghcr.io + +@@ -14,83 +17,110 @@ + +jobs: + +main: + +- permissions: + +- packages: write + +- contents: write + + runs-on: ubuntu-latest + + steps: + +- - uses: actions/checkout@v3 + +- - uses: actions/checkout@v6 + +- - name: Set node version + +- uses: actions/setup-node@v3 + +- with: + +- node-version: '18.x' + +- - name: Set node version + +- uses: actions/setup-node@v6 + +- with: + +- node-version: 18 + +- registry-url: "https://registry.npmjs.org" + +- - name: Install + +- run: | + +- export DETECT_CHROMEDRIVER_VERSION=true + +- npm ci + +- npm run setheapsize + +- - name: Install + +- run: | + +- export DETECT_CHROMEDRIVER_VERSION=true + +- npm ci + +- npm run setheapsize + +- - name: Lint + +- run: npx grunt lint + +- - name: Lint + +- run: npx grunt lint + +- - name: Unit Tests + +- run: | + +- npm test + +- npm run testnodeconsumer + +- - name: Unit Tests + +- run: | + +- npm test + +- npm run testnodeconsumer + +- - name: Production Build + +- run: npx grunt prod + +- - name: Production Build + +- run: npx grunt prod + +- - name: UI Tests + +- run: | + +- sudo apt-get install xvfb + +- xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + +- - name: UI Tests + +- run: | + +- sudo apt-get install xvfb + +- xvfb-run --server-args="-screen 0 1200x800x24" npx grunt testui + +- - name: Image Metadata + +- id: image-metadata + +- uses: docker/metadata-action@v4 + +- with: + +- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + +- tags: | + +- type=semver,pattern={{major}} + +- type=semver,pattern={{major}}.{{minor}} + +- type=semver,pattern={{version}} + +- - name: Set up Docker Buildx + +- uses: docker/setup-buildx-action@v3 + +- - name: Production Image Build + +- id: build-image + +- uses: redhat-actions/buildah-build@v2 + +- with: + +- tags: ${{ steps.image-metadata.outputs.tags }} + +- labels: ${{ steps.image-metadata.outputs.labels }} + +- containerfiles: ./Dockerfile + +- platforms: linux/amd64,linux/arm64 + +- oci: true + +- # enable build layer caching between platforms + +- layers: true + +- # Webpack seems to use a lot of open files, increase the max open file limit to accomodate. + +- extra-args: | + +- --ulimit nofile=10000 + +- - name: Set up QEMU + +- uses: docker/setup-qemu-action@v3 + +- - name: Publish to GHCR + +- uses: redhat-actions/push-to-registry@v2 + +- with: + +- image: ${{ steps.build-image.outputs.image }} + +- tags: ${{ steps.build-image.outputs.tags }} + +- registry: ${{ env.REGISTRY }} + +- username: ${{ env.REGISTRY_USER }} + +- password: ${{ env.REGISTRY_PASSWORD }} + +- - name: Image Metadata + +- id: image-metadata + +- uses: docker/metadata-action@v4 + +- with: + +- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + +- tags: | + +- type=semver,pattern={{major}} + +- type=semver,pattern={{major}}.{{minor}} + +- type=semver,pattern={{version}} + +- - name: Upload Release Assets + +- id: upload-release-assets + +- uses: svenstaro/upload-release-action@v2 + +- with: + +- repo_token: ${{ secrets.GITHUB_TOKEN }} + +- file: build/prod/*.zip + +- tag: ${{ github.ref }} + +- overwrite: true + +- file_glob: true + +- body: "See the [CHANGELOG](https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md) and [commit messages](https://github.com/gchq/CyberChef/commits/master) for details." + +- - name: Log in to GHCR + +- uses: docker/login-action@v3 + +- with: + +- registry: ${{ env.REGISTRY }} + +- username: ${{ env.REGISTRY_USER }} + +- password: ${{ env.REGISTRY_PASSWORD }} + +- - name: Publish to NPM + +- uses: JS-DevTools/npm-publish@v1 + +- with: + +- token: ${{ secrets.NPM_TOKEN }} + +- - name: Publish to GHCR + +- uses: docker/build-push-action@v6 + +- with: + +- context: . + +- push: true + +- tags: ${{ steps.image-metadata.outputs.tags }} + +- labels: ${{ steps.image-metadata.outputs.labels }} + +- platforms: linux/amd64,linux/arm64 + +- + +- - name: Upload Release Assets + +- id: upload-release-assets + +- uses: svenstaro/upload-release-action@v2 + +- with: + +- repo_token: ${{ secrets.GITHUB_TOKEN }} + +- file: build/prod/*.zip + +- tag: ${{ github.ref }} + +- overwrite: true + +- file_glob: true + +- body: "See the [CHANGELOG](https://github.com/gchq/CyberChef/blob/master/CHANGELOG.md) and [commit messages](https://github.com/gchq/CyberChef/commits/master) for details." + +- + +- npm-publish: + +- permissions: + +- id-token: write + +- contents: read + +- needs: main + +- runs-on: ubuntu-latest + +- steps: + +- - uses: actions/checkout@v6 + +- + +- - name: Set node version + +- uses: actions/setup-node@v6 + +- with: + +- node-version: 18 + +- registry-url: "https://registry.npmjs.org" + +- + +- - name: Install + +- run: npm ci + +- + +- - name: Create machine generated files + +- run: npm run node + +- + +- - name: Reset node version ready for publish + +- uses: actions/setup-node@v6 + +- with: + +- node-version: ^24.5 + +- registry-url: "https://registry.npmjs.org" + +- + +- - name: Publish to NPM + +- run: npm publish + +REMOVED in gchq (exists in mkilijanek): +.github/workflows/security-auto-fix.yml + +CHANGED: CHANGELOG.md — mkilijanek/CHANGELOG.md +++ gchq/CHANGELOG.md @@ +-12,6 +12,104 @@ + +## Details + +- + ++### [10.22.0] - 2026-02-11 + ++- Separate npm publish out into separate job and run with Node 24.5 +[@GCHQDeveloper581] | [#2188] + ++- Fixed Percent delimiter for hex encoding [@beneri] [@C85297] | +[#2137] + ++- Added the ability to paste one or more Images from the Clipboard +[@t-martine] [@a3957273] [@C85297] | [#1876] + ++- Quoted Printable - consistent reference to ‘email’ [@wesinator] | +[#2186] + ++- Fix freeze when output text decoding fails [@Raka-loah] | [#1573] + ++- Update Browserslist DB [@C85297] | [#2183] + ++- Add contents write permission to releases workflow [@C85297] | +[#2182] + ++- Fix release workflow permissions [@C85297] | [#2181] + +- + ++### [10.21.0] - 2026-02-05 + ++- Fix import operations with special chars in them [@d98762625] +[@jg42526] | [#1040] + ++- Remove custom CodeQL workflow [@C85297] | [#2176] + ++- Fix code scanning warnings in workflows [@GCHQDeveloper581] | [#2177] + ++- Use NPM trusted publishing [@C85297] [@GCHQDeveloper581] | [#2174] + ++- Fix: Correctly parse xxd odd byte hexdumps [@ThomasNotTom] +[@GCHQDeveloper581] | [#2058] + ++- Update Sitemap URLs to Use Valid Paths in sitemap.mjs [@rbpi] +[@C85297] | [#1861] + ++- Use recommended GitHub Actions to build image [@AlexGustafsson] +[@C85297] | [#2055] + ++- Remove version 10 message from banner [@C85297] | [#2169] + ++- Bump form-data from 4.0.1 to 4.0.5 | [#2175] + ++- Bump node-forge from 1.3.1 to 1.3.3 | [#2173] + ++- Update crypto browserify [@C85297] | [#2172] + ++- Update kbpgp package (resolves #2135) [@GCHQDeveloper581] | [#2136] + ++- Fix the processing of ALPNs for JA4 to align with new specification +update [@tuliperis] | [#2165] + ++- Add Bech32 and Bech32m encoding/decoding operations [@thomasxm] | +[#2159] + ++- Exclude Delete character from hex dump output [@mikecat] [@C85297] | +[#2086] + ++- Tiny typo fix in “To Base85” operation [@twostraws] | [#2118] + ++- Bump jsonpath-plus [@C85297] | [#2166] + +- + ++### [10.20.0] - 2026-01-28 + ++- Fixed Optical Character Recognition and added tests [@n1474335] | +[ab37c1e] + ++- Fixed JA4 version fallback value [@n1474335] | [7a5225c] + ++- Updated chromedriver [@n1474335] | [0e82e4b] + ++- Fixed RSA Sign and Verify character encodings [@n1474335] | [895a929] + ++- Updated chromedriver [@n1474335] | [d3adfc7] + ++- Added message format arg to RSA Verify operation [@n1474335] | +[47c85a1] + ++- Add operation for parsing X.509 CRLs [@robinsandhu] | [#1887] + ++- Fix typo in description of JWT Sign recipe [@GuilhermoReadonly] | +[#1961] + ++- Corrected path to generateNodeIndex.mjs [@simonarnell] | [#1959] + ++- Add ‘header’ ingredient to JWT Sign operation [@RandomByte] | [#1957] + ++- Add Parse TLS record operation [@c65722] | [#1936] + ++- Automatically detect chrome driver version [@gchq] | [#1972] + ++- Add Strip UDP header operation [@c65722] | [#1900] + ++- Add Strip TCP header operation [@c65722] | [#1898] + ++- Webpack compress with gzip and brotli [@max0x53] | [#1955] + ++- add offset field to ‘Add Line Numbers’ operation [@Adamkadaban] | +[#1866] + ++- Disable flakey URL test [@a3957273] | [#1973] + ++- Add Strip IPv4 header operation [@c65722] | [#1899] + ++- IPv6 Transition Operation [@jb30795] | [#1780] + ++- fix: Blowfish - ignore IV length in ECB mode [@FranciscoPombal] | +[#1902] + ++- Add ‘Drop nth bytes’ operation [@Oshawk] | [#1914] + ++- Add ‘Take nth bytes’ operation [@Oshawk] | [#1915] + ++- Add Leet Speak [@bartblaze] | [#1971] + ++- Fix Generate TOTP & HOPT [@exactlyaron] | [#1966] + ++- Updated luhn checksum operation to work with different bases [@k3ach] +| [#1933] + ++- automatically theme mode based on user preference [@vs4vijay] | +[#1921] + ++- fix: DES/Triple DES - misleading error messages [@FranciscoPombal] | +[#1904] + ++- fix: ROT13 - shifting numbers by negative amounts [@FranciscoPombal] +| [#1903] + ++- Introduce Yubico’s Modhex for Conversion [@linuxgemini] | [#1105] + ++- Feature: MIME RFC2047 Decoding [@MShwed] | [#630] + ++- CC-1889 add _ option [@depperm] | [#1977] + ++- chore(root): add cspell [@evenstensberg] | [#1976] + ++- Preserve uppercase for Leet Speak [@bartblaze] | [#1981] + ++- Load the user’s preferred color scheme if the URL contains an invalid +theme [@0xh3xa] | [#2007] + ++- Add SM2 Encrypt and Decrypt Operations [@flakjacket95] | [#1909] + ++- Support jq as an operation. [@zhzy0077] | [#1604] + ++- Add fingerprints to the ‘Parse X.509 certificate’ operation +[@JSCU-CNI] | [#1863] + ++- Added a JSON to YAML and a YAML to JSON operation [@ccarpo] | [#1286] + ++- Add CRC Operation [@r4mos] | [#1993] + ++- Bug Fix: selected theme not loading when refreshing [@0xh3xa] | +[#2006] + ++- Fix(RecipeWaiter): sanitize user input in addOperation to prevent XSS +[@0xh3xa] | [#2014] + ++- Docker multiplatform build support [@PathToLife] | [#1974] + ++- Add Base32 Hex Extended Alphabet and Base32 Tests. [@peterc-s] | +[#1991] + ++- Add ECB/NoPadding and CBC/NoPadding support to AES encryption +[@plvie] | [#2013] + ++- Add new operation: PHP Serialize [@brun0ne] | [#1548] + ++- Push input through postmessage [@kenduguay1] | [#1992] + ++- Add jsonata query operation [@jonking-ajar] | [#1587] + ++- Re-enable Npm Release in github workflows [@PathToLife] | [#2031] + ++- Add to ECDSA Verify the message format [@r4mos] | [#2027] + ++- Added alternating caps functionality [@sw5678] | [#1897] + ++- XOR Checksum operation added [@jg42526] | [#2035] + ++- Add GenerateAllChecksums operation * Remove checksums from +GenerateAllHashes operation [@es45411] | [66d445c] + ++- Update GenerateAllChecksums infoURL [@es45411] | [#2037] + ++- Add toggle “+” character to URLDecode operation [@es45411] | [#2040] + ++- Workaround for Safari load bug [@GCHQDeveloper94872] | [#2038] + ++- Updated Dockerfile to correctly build on ARM64 platforms [@Sma-Das] | +[#2042] + ++- Addresses bug report #2008 Added explicit support for octal IP +addresses. Changed approach to IPv4 regex to be string manipulation +generated. Added some unit tests for IP address parsing - probably not +full coverage. Added lookahead and lookbehind tricks to resolve warned +issue that 1.2.3.256 would still be extracted as 1.2.3.25. Now only +accepts valid IP addresses. Warning replaced with clause about infinite +length dotted decimal forms. [@gchqdev364] | [#2041] + ++- Remove trim from rail fence [@Odyhibit] | [#1986] + ++- Fix email regex [@ericli-splunk] | [#2025] + ++- Add Blake3 hashing [@xumptex] | [#2023] + ++- Use defaultIndex instead of 0 in transformArgs [@bartvanandel] | +[#2015] + ++- Add “Generate UUID” and “Analyse UUID” operations [@bartvanandel] | +[#2011] + ++- Add new operation: Template [@kendallgoto] | [#2021] + ++- Add more clear build instructions [@remingtr] | [#1873] + ++- Show On Map updated to use leaflet over WikiMedia [@0xff1ce] | +[#1884] + ++- Fixed ToDecimal signed logic [@starplanet] | [#1545] + ++- Use BigInt for encoding/decoding VarInt [@mikecat] | [#1978] + +### 10.19.0 - 2024-06-21 + +- Add support for ECDSA and DSA in ‘Parse CSR’ [@robinsandhu] | + [#1828] + +@@ -440,6 +538,9 @@ ## [4.0.0] - 2016-11-28 + +- Initial open source commit [@n1474335] | b1d73a72 + ++[10.22.0]: https://github.com/gchq/CyberChef/releases/tag/v10.22.0 + ++[10.21.0]: https://github.com/gchq/CyberChef/releases/tag/v10.21.0 + ++[10.20.0]: https://github.com/gchq/CyberChef/releases/tag/v10.20.0 + +@@ -630,6 +731,72 @@ [@cplussharp]: https://github.com/cplussharp + +[@robinsandhu]: https://github.com/robinsandhu + +[@eltociear]: https://github.com/eltociear + ++[@GuilhermoReadonly]: https://github.com/GuilhermoReadonly + ++[@simonarnell]: https://github.com/simonarnell + ++[@RandomByte]: https://github.com/RandomByte + ++[@c65722]: https://github.com/c65722 + ++[@c65722]: https://github.com/c65722 + ++[@c65722]: https://github.com/c65722 + ++[@max0x53]: https://github.com/max0x53 + ++[@Adamkadaban]: https://github.com/Adamkadaban + ++[@c65722]: https://github.com/c65722 + ++[@jb30795]: https://github.com/jb30795 + ++[@FranciscoPombal]: https://github.com/FranciscoPombal + ++[@Oshawk]: https://github.com/Oshawk + ++[@Oshawk]: https://github.com/Oshawk + ++[@bartblaze]: https://github.com/bartblaze + ++[@exactlyaron]: https://github.com/exactlyaron + ++[@k3ach]: https://github.com/k3ach + ++[@vs4vijay]: https://github.com/vs4vijay + ++[@FranciscoPombal]: https://github.com/FranciscoPombal + ++[@FranciscoPombal]: https://github.com/FranciscoPombal + ++[@linuxgemini]: https://github.com/linuxgemini + ++[@depperm]: https://github.com/depperm + ++[@evenstensberg]: https://github.com/evenstensberg + ++[@bartblaze]: https://github.com/bartblaze + ++[@0xh3xa]: https://github.com/0xh3xa + ++[@flakjacket95]: https://github.com/flakjacket95 + ++[@zhzy0077]: https://github.com/zhzy0077 + ++[@JSCU-CNI]: https://github.com/JSCU-CNI + ++[@ccarpo]: https://github.com/ccarpo + ++[@r4mos]: https://github.com/r4mos + ++[@0xh3xa]: https://github.com/0xh3xa + ++[@0xh3xa]: https://github.com/0xh3xa + ++[@PathToLife]: https://github.com/PathToLife + ++[@peterc-s]: https://github.com/peterc-s + ++[@plvie]: https://github.com/plvie + ++[@kenduguay1]: https://github.com/kenduguay1 + ++[@jonking-ajar]: https://github.com/jonking-ajar + ++[@PathToLife]: https://github.com/PathToLife + ++[@r4mos]: https://github.com/r4mos + ++[@jg42526]: https://github.com/jg42526 + ++[@es45411]: https://github.com/es45411 + ++[@gchq]: https://github.com/gchq + ++[@gchqdev364]: https://github.com/gchqdev364 + ++[@GCHQDeveloper94872]: https://github.com/GCHQDeveloper94872 + ++[@Sma-Das]: https://github.com/Sma-Das + ++[@gchq]: https://github.com/gchq + ++[@Odyhibit]: https://github.com/Odyhibit + ++[@ericli-splunk]: https://github.com/ericli-splunk + ++[@xumptex]: https://github.com/xumptex + ++[@bartvanandel]: https://github.com/bartvanandel + ++[@bartvanandel]: https://github.com/bartvanandel + ++[@kendallgoto]: https://github.com/kendallgoto + ++[@remingtr]: https://github.com/remingtr + ++[@0xff1ce]: https://github.com/0xff1ce + ++[@starplanet]: https://github.com/starplanet + ++[@C85297]: https://github.com/C85297 + ++[@GCHQDeveloper581]: https://github.com/GCHQDeveloper581 + ++[@ThomasNotTom]: https://github.com/ThomasNotTom + ++[@rbpi]: https://github.com/rbpi + ++[@AlexGustafsson]: https://github.com/AlexGustafsson + ++[@tuliperis]: https://github.com/tuliperis + ++[@thomasxm]: https://github.com/thomasxm + ++[@twostraws]: https://github.com/twostraws + ++[@beneri]: https://github.com/beneri + ++[@t-martine]: https://github.com/t-martine + ++[@wesinator]: https://github.com/wesinator + ++[@Raka-loah]: https://github.com/Raka-loah + +@@ -642,6 +809,46 @@ [760eff4]: +https://github.com/gchq/CyberChef/commit/760eff49b5307aaa3104c5e5b437ffe62299acd1 + ++[66d445c]: +https://github.com/gchq/CyberChef/commit/66d445c5ef4e8bd896fd15396e3ce2d660d8ace1 + ++[ab37c1e]: +https://github.com/gchq/CyberChef/commit/ab37c1e562dbee0495ed32876ecbb8225282af25 + ++[965570d]: +https://github.com/gchq/CyberChef/commit/965570d2504c17ee1f96211a1dc10ed40cd2b332 + ++[a477f47]: +https://github.com/gchq/CyberChef/commit/a477f47aecd01d78b11fe186ed4b20d9c487cfac + ++[7a5225c]: +https://github.com/gchq/CyberChef/commit/7a5225c961a5e0d192b03152117cd10a761f73d6 + ++[5f88ae4]: +https://github.com/gchq/CyberChef/commit/5f88ae44ec77228d9bed8f11e8cc8e7dcfb36914 + ++[0e82e4b]: +https://github.com/gchq/CyberChef/commit/0e82e4b7c6c77cadb8be61cb145e081d6ecfdc88 + ++[d635cca]: +https://github.com/gchq/CyberChef/commit/d635cca2106aae2a59caf0e5d7e3633ee1ea3155 + ++[895a929]: +https://github.com/gchq/CyberChef/commit/895a9299255525cb57886deb9d9fd4ba17ae9548 + ++[270a333]: +https://github.com/gchq/CyberChef/commit/270a33317944612d27ea1cc15275ad6b0ed097e5 + ++[d3adfc7]: +https://github.com/gchq/CyberChef/commit/d3adfc7c3e5719279524356bce5261bd8350c0f8 + ++[47c85a1]: +https://github.com/gchq/CyberChef/commit/47c85a105ddbdd4cabfa44ddddbc56e3907a8c33 + ++[3822c6c]: +https://github.com/gchq/CyberChef/commit/3822c6c520a0b4200abc675c33f46082f5b9efc6 + ++[66d445c]: +https://github.com/gchq/CyberChef/commit/66d445c5ef4e8bd896fd15396e3ce2d660d8ace1 + ++[ab37c1e]: +https://github.com/gchq/CyberChef/commit/ab37c1e562dbee0495ed32876ecbb8225282af25 + ++[965570d]: +https://github.com/gchq/CyberChef/commit/965570d2504c17ee1f96211a1dc10ed40cd2b332 + ++[a477f47]: +https://github.com/gchq/CyberChef/commit/a477f47aecd01d78b11fe186ed4b20d9c487cfac + ++[7a5225c]: +https://github.com/gchq/CyberChef/commit/7a5225c961a5e0d192b03152117cd10a761f73d6 + ++[5f88ae4]: +https://github.com/gchq/CyberChef/commit/5f88ae44ec77228d9bed8f11e8cc8e7dcfb36914 + ++[0e82e4b]: +https://github.com/gchq/CyberChef/commit/0e82e4b7c6c77cadb8be61cb145e081d6ecfdc88 + ++[d635cca]: +https://github.com/gchq/CyberChef/commit/d635cca2106aae2a59caf0e5d7e3633ee1ea3155 + ++[895a929]: +https://github.com/gchq/CyberChef/commit/895a9299255525cb57886deb9d9fd4ba17ae9548 + ++[270a333]: +https://github.com/gchq/CyberChef/commit/270a33317944612d27ea1cc15275ad6b0ed097e5 + ++[d3adfc7]: +https://github.com/gchq/CyberChef/commit/d3adfc7c3e5719279524356bce5261bd8350c0f8 + ++[47c85a1]: +https://github.com/gchq/CyberChef/commit/47c85a105ddbdd4cabfa44ddddbc56e3907a8c33 + ++[3822c6c]: +https://github.com/gchq/CyberChef/commit/3822c6c520a0b4200abc675c33f46082f5b9efc6 + ++[66d445c]: +https://github.com/gchq/CyberChef/commit/66d445c5ef4e8bd896fd15396e3ce2d660d8ace1 + ++[ab37c1e]: +https://github.com/gchq/CyberChef/commit/ab37c1e562dbee0495ed32876ecbb8225282af25 + ++[965570d]: +https://github.com/gchq/CyberChef/commit/965570d2504c17ee1f96211a1dc10ed40cd2b332 + ++[a477f47]: +https://github.com/gchq/CyberChef/commit/a477f47aecd01d78b11fe186ed4b20d9c487cfac + ++[7a5225c]: +https://github.com/gchq/CyberChef/commit/7a5225c961a5e0d192b03152117cd10a761f73d6 + ++[5f88ae4]: +https://github.com/gchq/CyberChef/commit/5f88ae44ec77228d9bed8f11e8cc8e7dcfb36914 + ++[0e82e4b]: +https://github.com/gchq/CyberChef/commit/0e82e4b7c6c77cadb8be61cb145e081d6ecfdc88 + ++[d635cca]: +https://github.com/gchq/CyberChef/commit/d635cca2106aae2a59caf0e5d7e3633ee1ea3155 + ++[895a929]: +https://github.com/gchq/CyberChef/commit/895a9299255525cb57886deb9d9fd4ba17ae9548 + ++[270a333]: +https://github.com/gchq/CyberChef/commit/270a33317944612d27ea1cc15275ad6b0ed097e5 + ++[d3adfc7]: +https://github.com/gchq/CyberChef/commit/d3adfc7c3e5719279524356bce5261bd8350c0f8 + ++[47c85a1]: +https://github.com/gchq/CyberChef/commit/47c85a105ddbdd4cabfa44ddddbc56e3907a8c33 + ++[3822c6c]: +https://github.com/gchq/CyberChef/commit/3822c6c520a0b4200abc675c33f46082f5b9efc6 + ++[66d445c]: +https://github.com/gchq/CyberChef/commit/66d445c5ef4e8bd896fd15396e3ce2d660d8ace1 + +@@ -778,4 +985,29 @@ [#512]: +https://github.com/gchq/CyberChef/issues/512 + +- + ++[#1040]: https://github.com/gchq/CyberChef/pull/1040 + ++[#2176]: https://github.com/gchq/CyberChef/pull/2176 + ++[#2177]: https://github.com/gchq/CyberChef/pull/2177 + ++[#2174]: https://github.com/gchq/CyberChef/pull/2174 + ++[#2058]: https://github.com/gchq/CyberChef/pull/2058 + ++[#1861]: https://github.com/gchq/CyberChef/pull/1861 + ++[#2055]: https://github.com/gchq/CyberChef/pull/2055 + ++[#2169]: https://github.com/gchq/CyberChef/pull/2169 + ++[#2175]: https://github.com/gchq/CyberChef/pull/2175 + ++[#2173]: https://github.com/gchq/CyberChef/pull/2173 + ++[#2172]: https://github.com/gchq/CyberChef/pull/2172 + ++[#2136]: https://github.com/gchq/CyberChef/pull/2136 + ++[#2165]: https://github.com/gchq/CyberChef/pull/2165 + ++[#2159]: https://github.com/gchq/CyberChef/pull/2159 + ++[#2086]: https://github.com/gchq/CyberChef/pull/2086 + ++[#2118]: https://github.com/gchq/CyberChef/pull/2118 + ++[#2166]: https://github.com/gchq/CyberChef/pull/2166 + ++[#2188]: https://github.com/gchq/CyberChef/pull/2188 + ++[#2137]: https://github.com/gchq/CyberChef/pull/2137 + ++[#1876]: https://github.com/gchq/CyberChef/pull/1876 + ++[#2186]: https://github.com/gchq/CyberChef/pull/2186 + ++[#1573]: https://github.com/gchq/CyberChef/pull/1573 + ++[#2183]: https://github.com/gchq/CyberChef/pull/2183 + ++[#2182]: https://github.com/gchq/CyberChef/pull/2182 + ++[#2181]: https://github.com/gchq/CyberChef/pull/2181 + +- + +CHANGED: Dockerfile — mkilijanek/Dockerfile +++ gchq/Dockerfile @@ -27,9 ++27,6 @@ ######################################### + +# Package static build files into nginx # + +######################################### + +-# We are using Github Actions: redhat-actions/buildah-build@v2 which +needs manual selection of arch in base image + +-# Remove TARGETARCH if docker buildx is supported in the CI release as +–platform=$TARGETPLATFORM will be automatically set + +-ARG TARGETPLATFORM + +-FROM –platform=${TARGETPLATFORM} nginx:stable-alpine AS cyberchef + ++FROM nginx:stable-alpine AS cyberchef + +COPY –from=builder /app/build/prod /usr/share/nginx/html/ + +REMOVED in gchq (exists in mkilijanek): Makefile REMOVED in gchq (exists +in mkilijanek): SECURITY_ANALYSIS.md REMOVED in gchq (exists in +mkilijanek): SECURITY_AUTOMATION.md REMOVED in gchq (exists in +mkilijanek): SECURITY_FIXES_APPLIED.md REMOVED in gchq (exists in +mkilijanek): SECURITY_QUICK_START.md + +CHANGED: package-lock.json — mkilijanek/package-lock.json +++ +gchq/package-lock.json @@ -1,12 +1,12 @@ { + +“name”: “cyberchef”, + +- “version”: “10.19.4”, + +- “version”: “10.22.1”, + + “lockfileVersion”: 3, + + “requires”: true, + + “packages”: { + + ““: { + + "name": "cyberchef", + +- "version": "10.19.4", + +- "version": "10.22.1", + + "hasInstallScript": true, + + "license": "Apache-2.0", + + "dependencies": { + +@@ -31,7 +31,7 @@ “chi-squared”: “^1.1.0”, + + "codepage": "^1.15.0", + + "crypto-api": "^0.8.5", + +- "crypto-browserify": "^3.12.0", + +- "crypto-browserify": "^3.12.1", + + "crypto-js": "^4.2.0", + + "ctph.js": "0.0.5", + + "d3": "7.9.0", + +@@ -58,10 +58,10 @@ “json5”: “^2.2.3”, + + "jsonata": "^2.0.3", + + "jsonpath-plus": "^10.3.0", + +- "jsonwebtoken": "9.0.0", + +- "jsonwebtoken": "8.5.1", + + "jsqr": "^1.4.0", + + "jsrsasign": "^11.1.0", + +- "kbpgp": "2.1.15", + +- "kbpgp": "^2.1.17", + + "libbzip2-wasm": "0.0.4", + + "libyara-wasm": "^1.2.1", + + "lodash": "^4.17.21", + +@@ -156,7 +156,7 @@ “terser”: “^5.31.1”, + + "webpack": "^5.91.0", + + "webpack-bundle-analyzer": "^4.10.2", + +- "webpack-dev-server": "5.2.1", + +- "webpack-dev-server": "5.0.4", + + "webpack-node-externals": "^3.0.0", + + "worker-loader": "^3.0.8" + + } + +@@ -255,7 +255,6 @@ “integrity”: +“sha512-i1SLeK+DzNnQ3LL/CswPCa/E5u4lh1k6IAEphON8F+cXt0t9euTshDru0q7/IqMa1PMPz5RnHuHscF8/ZJsStg==”, + + "dev": true, + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "@ampproject/remapping": "^2.2.0", + + "@babel/code-frame": "^7.26.0", + +@@ -1744,16 +1743,23 @@ } + + }, + + "node_modules/@babel/runtime-corejs3": { + +- "version": "7.28.4", + +- "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.28.4.tgz", + +- "integrity": "sha512-h7iEYiW4HebClDEhtvFObtPmIvrd1SSfpI9EhOeKk4CtIK/ngBWFpuhCzhdmRKtg71ylcue+9I6dv54XYO1epQ==", + +- "license": "MIT", + +- "dependencies": { + +- "core-js-pure": "^3.43.0" + +- "version": "7.26.0", + +- "resolved": "https://registry.npmjs.org/@babel/runtime-corejs3/-/runtime-corejs3-7.26.0.tgz", + +- "integrity": "sha512-YXHu5lN8kJCb1LOb9PgV6pvak43X2h4HvRApcN5SdWeaItQOzfn1hgP6jasD6KWQyJDBxrVmA9o9OivlnNJK/w==", + +- "license": "MIT", + +- "dependencies": { + +- "core-js-pure": "^3.30.2", + +- "regenerator-runtime": "^0.14.0" + + }, + + "engines": { + + "node": ">=6.9.0" + + } + +- }, + +- “node_modules/@babel/runtime-corejs3/node_modules/regenerator-runtime”: + { + +- "version": "0.14.1", + +- "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + +- "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + +- "license": "MIT" + + }, + + “node_modules/@babel/runtime/node_modules/regenerator-runtime”: { + + "version": "0.14.1", + +@@ -2098,8 +2104,7 @@ “resolved”: +“https://registry.npmjs.org/@cspell/dict-css/-/dict-css-4.0.17.tgz”, + + "integrity": "sha512-2EisRLHk6X/PdicybwlajLGKF5aJf4xnX2uuG5lexuYKt05xV/J/OiBADmi8q9obhxf1nesrMQbqAt+6CsHo/w==", + + "dev": true, + +- "license": "MIT", + +- "peer": true + +- "license": "MIT" + + }, + + “node_modules/@cspell/dict-dart”: { + + "version": "2.3.0", + +@@ -2239,16 +2244,14 @@ “resolved”: +“https://registry.npmjs.org/@cspell/dict-html/-/dict-html-4.0.11.tgz”, + + "integrity": "sha512-QR3b/PB972SRQ2xICR1Nw/M44IJ6rjypwzA4jn+GH8ydjAX9acFNfc+hLZVyNe0FqsE90Gw3evLCOIF0vy1vQw==", + + "dev": true, + +- "license": "MIT", + +- "peer": true + +- "license": "MIT" + + }, + + “node_modules/@cspell/dict-html-symbol-entities”: { + + "version": "4.0.3", + + "resolved": "https://registry.npmjs.org/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-4.0.3.tgz", + + "integrity": "sha512-aABXX7dMLNFdSE8aY844X4+hvfK7977sOWgZXo4MTGAmOzR8524fjbJPswIBK7GaD3+SgFZ2yP2o0CFvXDGF+A==", + + "dev": true, + +- "license": "MIT", + +- "peer": true + +- "license": "MIT" + + }, + + “node_modules/@cspell/dict-java”: { + + "version": "5.0.11", + +@@ -2446,8 +2449,7 @@ “resolved”: +“https://registry.npmjs.org/@cspell/dict-typescript/-/dict-typescript-3.2.0.tgz”, + + "integrity": "sha512-Pk3zNePLT8qg51l0M4g1ISowYAEGxTuNfZlgkU5SvHa9Cu7x/BWoyYq9Fvc3kAyoisCjRPyvWF4uRYrPitPDFw==", + + "dev": true, + +- "license": "MIT", + +- "peer": true + +- "license": "MIT" + + }, + + “node_modules/@cspell/dict-vue”: { + + "version": "3.0.4", + +@@ -2588,7 +2590,6 @@ } + + ], + + "license": "MIT", + +- "peer": true, + + "engines": { + + "node": ">=18" + + }, + +@@ -2612,7 +2613,6 @@ } + + ], + + "license": "MIT", + +- "peer": true, + + "engines": { + + "node": ">=18" + + } + +@@ -2847,6 +2847,109 @@ “funding”: { + + "type": "github", + + "url": "https://github.com/sponsors/nzakas" + +- } + +- }, + +- “node_modules/@isaacs/cliui”: { + +- "version": "8.0.2", + +- "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", + +- "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", + +- "dev": true, + +- "license": "ISC", + +- "dependencies": { + +- "string-width": "^5.1.2", + +- "string-width-cjs": "npm:string-width@^4.2.0", + +- "strip-ansi": "^7.0.1", + +- "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", + +- "wrap-ansi": "^8.1.0", + +- "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" + +- }, + +- "engines": { + +- "node": ">=12" + +- } + +- }, + +- “node_modules/@isaacs/cliui/node_modules/ansi-regex”: { + +- "version": "6.1.0", + +- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", + +- "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", + +- "dev": true, + +- "license": "MIT", + +- "engines": { + +- "node": ">=12" + +- }, + +- "funding": { + +- "url": "https://github.com/chalk/ansi-regex?sponsor=1" + +- } + +- }, + +- “node_modules/@isaacs/cliui/node_modules/ansi-styles”: { + +- "version": "6.2.1", + +- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", + +- "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", + +- "dev": true, + +- "license": "MIT", + +- "engines": { + +- "node": ">=12" + +- }, + +- "funding": { + +- "url": "https://github.com/chalk/ansi-styles?sponsor=1" + +- } + +- }, + +- “node_modules/@isaacs/cliui/node_modules/emoji-regex”: { + +- "version": "9.2.2", + +- "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", + +- "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==", + +- "dev": true, + +- "license": "MIT" + +- }, + +- “node_modules/@isaacs/cliui/node_modules/string-width”: { + +- "version": "5.1.2", + +- "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", + +- "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "eastasianwidth": "^0.2.0", + +- "emoji-regex": "^9.2.2", + +- "strip-ansi": "^7.0.1" + +- }, + +- "engines": { + +- "node": ">=12" + +- }, + +- "funding": { + +- "url": "https://github.com/sponsors/sindresorhus" + +- } + +- }, + +- “node_modules/@isaacs/cliui/node_modules/strip-ansi”: { + +- "version": "7.1.0", + +- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", + +- "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "ansi-regex": "^6.0.1" + +- }, + +- "engines": { + +- "node": ">=12" + +- }, + +- "funding": { + +- "url": "https://github.com/chalk/strip-ansi?sponsor=1" + +- } + +- }, + +- “node_modules/@isaacs/cliui/node_modules/wrap-ansi”: { + +- "version": "8.1.0", + +- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", + +- "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "ansi-styles": "^6.1.0", + +- "string-width": "^5.0.1", + +- "strip-ansi": "^7.0.1" + +- }, + +- "engines": { + +- "node": ">=12" + +- }, + +- "funding": { + +- "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + + } + + }, + + “node_modules/@jimp/bmp”: { + +@@ -2907,7 +3010,6 @@ “resolved”: +“https://registry.npmjs.org/@jimp/custom/-/custom-0.22.12.tgz”, + + "integrity": "sha512-xcmww1O/JFP2MrlGUMd3Q78S3Qu6W3mYTXYuIqFq33EorgYHV/HqymHfXy9GjiCJ7OI+7lWx6nYFOzU7M4rd1Q==", + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "@jimp/core": "^0.22.12" + + } + +@@ -2944,7 +3046,6 @@ “resolved”: +“https://registry.npmjs.org/@jimp/plugin-blit/-/plugin-blit-0.22.12.tgz”, + + "integrity": "sha512-xslz2ZoFZOPLY8EZ4dC29m168BtDx95D6K80TzgUi8gqT7LY6CsajWO0FAxDwHz6h0eomHMfyGX0stspBrTKnQ==", + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "@jimp/utils": "^0.22.12" + + }, + +@@ -2957,7 +3058,6 @@ “resolved”: +“https://registry.npmjs.org/@jimp/plugin-blur/-/plugin-blur-0.22.12.tgz”, + + "integrity": "sha512-S0vJADTuh1Q9F+cXAwFPlrKWzDj2F9t/9JAbUvaaDuivpyWuImEKXVz5PUZw2NbpuSHjwssbTpOZ8F13iJX4uw==", + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "@jimp/utils": "^0.22.12" + + }, + +@@ -2982,7 +3082,6 @@ “resolved”: +“https://registry.npmjs.org/@jimp/plugin-color/-/plugin-color-0.22.12.tgz”, + + "integrity": "sha512-xImhTE5BpS8xa+mAN6j4sMRWaUgUDLoaGHhJhpC+r7SKKErYDR0WQV4yCE4gP+N0gozD0F3Ka1LUSaMXrn7ZIA==", + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "@jimp/utils": "^0.22.12", + + "tinycolor2": "^1.6.0" + +@@ -3026,7 +3125,6 @@ “resolved”: +“https://registry.npmjs.org/@jimp/plugin-crop/-/plugin-crop-0.22.12.tgz”, + + "integrity": "sha512-FNuUN0OVzRCozx8XSgP9MyLGMxNHHJMFt+LJuFjn1mu3k0VQxrzqbN06yIl46TVejhyAhcq5gLzqmSCHvlcBVw==", + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "@jimp/utils": "^0.22.12" + + }, + +@@ -3150,7 +3248,6 @@ “resolved”: +“https://registry.npmjs.org/@jimp/plugin-resize/-/plugin-resize-0.22.12.tgz”, + + "integrity": "sha512-3NyTPlPbTnGKDIbaBgQ3HbE6wXbAlFfxHVERmrbqAi8R3r6fQPxpCauA8UVDnieg5eo04D0T8nnnNIX//i/sXg==", + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "@jimp/utils": "^0.22.12" + + }, + +@@ -3163,7 +3260,6 @@ “resolved”: +“https://registry.npmjs.org/@jimp/plugin-rotate/-/plugin-rotate-0.22.12.tgz”, + + "integrity": "sha512-9YNEt7BPAFfTls2FGfKBVgwwLUuKqy+E8bDGGEsOqHtbuhbshVGxN2WMZaD4gh5IDWvR+emmmPPWGgaYNYt1gA==", + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "@jimp/utils": "^0.22.12" + + }, + +@@ -3179,7 +3275,6 @@ “resolved”: +“https://registry.npmjs.org/@jimp/plugin-scale/-/plugin-scale-0.22.12.tgz”, + + "integrity": "sha512-dghs92qM6MhHj0HrV2qAwKPMklQtjNpoYgAB94ysYpsXslhRTiPisueSIELRwZGEr0J0VUxpUY7HgJwlSIgGZw==", + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "@jimp/utils": "^0.22.12" + + }, + +@@ -3887,6 +3982,17 @@ “node”: “>= 8” + + } + + }, + +- “node_modules/@pkgjs/parseargs”: { + +- "version": "0.11.0", + +- "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", + +- "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", + +- "dev": true, + +- "license": "MIT", + +- "optional": true, + +- "engines": { + +- "node": ">=14" + +- } + +- }, + + “node_modules/@pkgr/core”: { + + “version”: “0.1.1”, + + “resolved”: + “https://registry.npmjs.org/@pkgr/core/-/core-0.1.1.tgz”, + +@@ -4508,7 +4614,6 @@ “integrity”: +“sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==”, + + "dev": true, + + "license": "MIT", + +- "peer": true, + + "bin": { + + "acorn": "bin/acorn" + + }, + +@@ -4555,7 +4660,6 @@ “integrity”: +“sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==”, + + "dev": true, + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "fast-deep-equal": "^3.1.1", + + "fast-json-stable-stringify": "^2.0.0", + +@@ -5064,14 +5168,14 @@ } + + }, + + "node_modules/axios": { + +- "version": "1.13.2", + +- "resolved": "https://registry.npmjs.org/axios/-/axios-1.13.2.tgz", + +- "integrity": "sha512-VPk9ebNqPcy5lRGuSlKx752IlDatOjT9paPlm8A7yOuW2Fbvp4X3JznJtT4f0GzGLLiWE9W8onz51SqLYwzGaA==", + +- "version": "1.7.9", + +- "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.9.tgz", + +- "integrity": "sha512-LhLcE7Hbiryz8oMDdDptSrWowmB4Bl6RCt6sIJKpRB4XtVf0iEgewX3au/pJqm+Py1kCASkb/FFKjxQaLtxJvw==", + + "dev": true, + + "license": "MIT", + + "dependencies": { + + "follow-redirects": "^1.15.6", + +- "form-data": "^4.0.4", + +- "form-data": "^4.0.0", + + "proxy-from-env": "^1.1.0" + + } + + }, + +@@ -5898,7 +6002,6 @@ } + + ], + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "caniuse-lite": "^1.0.30001688", + + "electron-to-chromium": "^1.5.73", + +@@ -6120,9 +6223,9 @@ } + + }, + + "node_modules/caniuse-lite": { + +- "version": "1.0.30001695", + +- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001695.tgz", + +- "integrity": "sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw==", + +- "version": "1.0.30001769", + +- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001769.tgz", + +- "integrity": "sha512-BCfFL1sHijQlBGWBMuJyhZUhzo7wer5sVj9hqekB/7xn0Ypy+pER/edCYQm4exbXj4WiySGp40P8UuTh6w1srg==", + + "dev": true, + + "funding": [ + + { + +@@ -6653,9 +6756,9 @@ } + + }, + + "node_modules/compression": { + +- "version": "1.8.1", + +- "resolved": "https://registry.npmjs.org/compression/-/compression-1.8.1.tgz", + +- "integrity": "sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==", + +- "version": "1.7.5", + +- "resolved": "https://registry.npmjs.org/compression/-/compression-1.7.5.tgz", + +- "integrity": "sha512-bQJ0YRck5ak3LgtnpKkiabX5pNF7tMUh1BSy2ZBOTh0Dim0BUu6aPPwByIns6/A5Prh8PufSPerMDUklpzes2Q==", + + "dev": true, + + "license": "MIT", + + "dependencies": { + +@@ -6663,7 +6766,7 @@ “compressible”: “~2.0.18”, + + "debug": "2.6.9", + + "negotiator": "~0.6.4", + +- "on-headers": "~1.1.0", + +- "on-headers": "~1.0.2", + + "safe-buffer": "5.2.1", + + "vary": "~1.1.2" + + }, + +@@ -6894,9 +6997,9 @@ } + + }, + + "node_modules/core-js-pure": { + +- "version": "3.47.0", + +- "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.47.0.tgz", + +- "integrity": "sha512-BcxeDbzUrRnXGYIVAGFtcGQVNpFcUhVjr6W7F8XktvQW2iJP9e66GP6xdKotCRFlrxBvNIBrhwKteRXqMV86Nw==", + +- "version": "3.40.0", + +- "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.40.0.tgz", + +- "integrity": "sha512-AtDzVIgRrmRKQai62yuSIN5vNiQjcJakJb4fbhVw3ehxx7Lohphvw9SGNWKhLFqSxC4ilD0g/L1huAYFQU3Q6A==", + + "hasInstallScript": true, + + "license": "MIT", + + "funding": { + +@@ -7801,7 +7904,6 @@ “resolved”: +“https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz”, + + "integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==", + + "license": "ISC", + +- "peer": true, + + "engines": { + + "node": ">=12" + + } + +@@ -8043,6 +8145,19 @@ }, + + "funding": { + + "url": "https://github.com/sponsors/sindresorhus" + +- } + +- }, + +- “node_modules/default-gateway”: { + +- "version": "6.0.3", + +- "resolved": "https://registry.npmjs.org/default-gateway/-/default-gateway-6.0.3.tgz", + +- "integrity": "sha512-fwSOJsbbNzZ/CUFpqFBqYfYNLj1NbMPm8MMCIzHjC83iSJRBEGmDUxU+WP661BaBQImeC2yHwXtz+P/O9o+XEg==", + +- "dev": true, + +- "license": "BSD-2-Clause", + +- "dependencies": { + +- "execa": "^5.0.0" + +- }, + +- "engines": { + +- "node": ">= 10" + + } + + }, + + “node_modules/defaults”: { + +@@ -8387,6 +8502,13 @@ “readable-stream”: “^2.0.0”, + + "stream-shift": "^1.0.0" + + } + +- }, + +- “node_modules/eastasianwidth”: { + +- "version": "0.2.0", + +- "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", + +- "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", + +- "dev": true, + +- "license": "MIT" + + }, + + “node_modules/ecdsa-sig-formatter”: { + + "version": "1.0.11", + +@@ -8720,7 +8842,6 @@ “integrity”: +“sha512-+waTfRWQlSbpt3KWE+CjrPPYnbq9kfZIYUqapc0uBXyjTp8aYXZDsUH16m39Ryq3NjAVP4tjuF7KaukeqoCoaA==”, + + "dev": true, + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "@eslint-community/eslint-utils": "^4.2.0", + + "@eslint-community/regexpp": "^4.12.1", + +@@ -9082,6 +9203,43 @@ “safe-buffer”: “^5.1.1” + + } + + }, + +- “node_modules/execa”: { + +- "version": "5.1.1", + +- "resolved": "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz", + +- "integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "cross-spawn": "^7.0.3", + +- "get-stream": "^6.0.0", + +- "human-signals": "^2.1.0", + +- "is-stream": "^2.0.0", + +- "merge-stream": "^2.0.0", + +- "npm-run-path": "^4.0.1", + +- "onetime": "^5.1.2", + +- "signal-exit": "^3.0.3", + +- "strip-final-newline": "^2.0.0" + +- }, + +- "engines": { + +- "node": ">=10" + +- }, + +- "funding": { + +- "url": "https://github.com/sindresorhus/execa?sponsor=1" + +- } + +- }, + +- “node_modules/execa/node_modules/get-stream”: { + +- "version": "6.0.1", + +- "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz", + +- "integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==", + +- "dev": true, + +- "license": "MIT", + +- "engines": { + +- "node": ">=10" + +- }, + +- "funding": { + +- "url": "https://github.com/sponsors/sindresorhus" + +- } + +- }, + + “node_modules/exif-parser”: { + + “version”: “0.1.12”, + + “resolved”: + “https://registry.npmjs.org/exif-parser/-/exif-parser-0.1.12.tgz”, + +@@ -9729,6 +9887,36 @@ “node”: “>=0.10.0” + + } + + }, + +- “node_modules/foreground-child”: { + +- "version": "3.3.0", + +- "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", + +- "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", + +- "dev": true, + +- "license": "ISC", + +- "dependencies": { + +- "cross-spawn": "^7.0.0", + +- "signal-exit": "^4.0.1" + +- }, + +- "engines": { + +- "node": ">=14" + +- }, + +- "funding": { + +- "url": "https://github.com/sponsors/isaacs" + +- } + +- }, + +- “node_modules/foreground-child/node_modules/signal-exit”: { + +- "version": "4.1.0", + +- "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", + +- "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + +- "dev": true, + +- "license": "ISC", + +- "engines": { + +- "node": ">=14" + +- }, + +- "funding": { + +- "url": "https://github.com/sponsors/isaacs" + +- } + +- }, + + “node_modules/form-data”: { + + “version”: “4.0.5”, + + “resolved”: + “https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz”, + +@@ -10202,7 +10390,6 @@ “integrity”: +“sha512-/ABUy3gYWu5iBmrUSRBP97JLpQUm0GgVveDCp6t3yRNIoltIYw7rEj3g5y1o2PGPR2vfTRGa7WC/LZHLTXnEzA==”, + + "dev": true, + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "dateformat": "~4.6.2", + + "eventemitter2": "~0.4.13", + +@@ -10899,6 +11086,23 @@ “node”: “>=18” + + } + + }, + +- “node_modules/html-entities”: { + +- "version": "2.5.2", + +- "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.5.2.tgz", + +- "integrity": "sha512-K//PSRMQk4FZ78Kyau+mZurHn3FH0Vwr+H36eE0rPbeYkRRi9YxceYPhuN60UwWorxyKHhqoAJl2OFKa4BVtaA==", + +- "dev": true, + +- "funding": [ + +- { + +- "type": "github", + +- "url": "https://github.com/sponsors/mdevils" + +- }, + +- { + +- "type": "patreon", + +- "url": "https://patreon.com/mdevils" + +- } + +- ], + +- "license": "MIT" + +- }, + + “node_modules/html-escaper”: { + + “version”: “2.0.2”, + + “resolved”: + “https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz”, + +@@ -11078,9 +11282,9 @@ } + + }, + + "node_modules/http-proxy-middleware": { + +- "version": "2.0.9", + +- "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.9.tgz", + +- "integrity": "sha512-c1IyJYLYppU574+YI7R4QyX2ystMtVXZwIdzazUIPIJsHuWNd+mho2j+bKoHftndicGj9yh+xjd+l0yj7VeT1Q==", + +- "version": "2.0.7", + +- "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz", + +- "integrity": "sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==", + + "dev": true, + + "license": "MIT", + + "dependencies": { + +@@ -11121,6 +11325,16 @@ }, + + "engines": { + + "node": ">= 14" + +- } + +- }, + +- “node_modules/human-signals”: { + +- "version": "2.1.0", + +- "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-2.1.0.tgz", + +- "integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==", + +- "dev": true, + +- "license": "Apache-2.0", + +- "engines": { + +- "node": ">=10.17.0" + + } + + }, + + “node_modules/hyperdyperid”: { + +@@ -11810,6 +12024,19 @@ “url”: “https://github.com/sponsors/ljharb” + + } + + }, + +- “node_modules/is-stream”: { + +- "version": "2.0.1", + +- "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + +- "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + +- "dev": true, + +- "license": "MIT", + +- "engines": { + +- "node": ">=8" + +- }, + +- "funding": { + +- "url": "https://github.com/sponsors/sindresorhus" + +- } + +- }, + + “node_modules/is-string”: { + + “version”: “1.1.1”, + + “resolved”: + “https://registry.npmjs.org/is-string/-/is-string-1.1.1.tgz”, + +@@ -12000,6 +12227,22 @@ “dev”: true, + + "license": "MIT" + + }, + +- “node_modules/jackspeak”: { + +- "version": "3.4.3", + +- "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", + +- "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", + +- "dev": true, + +- "license": "BlueOak-1.0.0", + +- "dependencies": { + +- "@isaacs/cliui": "^8.0.2" + +- }, + +- "funding": { + +- "url": "https://github.com/sponsors/isaacs" + +- }, + +- "optionalDependencies": { + +- "@pkgjs/parseargs": "^0.11.0" + +- } + +- }, + + “node_modules/jake”: { + + “version”: “10.9.2”, + + “resolved”: “https://registry.npmjs.org/jake/-/jake-10.9.2.tgz”, + +@@ -12114,7 +12357,6 @@ “integrity”: +“sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==”, + + "dev": true, + + "license": "MIT", + +- "peer": true, + + "bin": { + + "jiti": "bin/jiti.js" + + } + +@@ -12135,8 +12377,7 @@ “version”: “3.7.1”, + + "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz", + + "integrity": "sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==", + +- "license": "MIT", + +- "peer": true + +- "license": "MIT" + + }, + + “node_modules/js-sha3”: { + + "version": "0.9.3", + +@@ -12227,7 +12468,6 @@ “resolved”: +“https://registry.npmjs.org/jsep/-/jsep-1.4.0.tgz”, + + "integrity": "sha512-B7qPcEVE3NVkmSJbaYxvv4cHkVW7DQsZz13pUMrfS8z8Q/BuShN+gcTXrUlPiGqM2/t/EEaI030bpxMqY8gMlw==", + + "license": "MIT", + +- "peer": true, + + "engines": { + + "node": ">= 10.16.0" + + } + +@@ -12311,31 +12551,34 @@ } + + }, + + "node_modules/jsonwebtoken": { + +- "version": "9.0.0", + +- "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.0.tgz", + +- "integrity": "sha512-tuGfYXxkQGDPnLJ7SibiQgVgeDgfbPq2k2ICcbgqW8WxWLBAxKQM/ZCu/IT8SOSwmaYl4dpTFCW5xZv7YbbWUw==", + +- "version": "8.5.1", + +- "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-8.5.1.tgz", + +- "integrity": "sha512-XjwVfRS6jTMsqYs0EsuJ4LGxXV14zQybNd4L2r0UvbVnSF9Af8x7p5MzbJ90Ioz/9TI41/hTCvznF/loiSzn8w==", + + "license": "MIT", + + "dependencies": { + + "jws": "^3.2.2", + +- "lodash": "^4.17.21", + +- "lodash.includes": "^4.3.0", + +- "lodash.isboolean": "^3.0.3", + +- "lodash.isinteger": "^4.0.4", + +- "lodash.isnumber": "^3.0.3", + +- "lodash.isplainobject": "^4.0.6", + +- "lodash.isstring": "^4.0.1", + +- "lodash.once": "^4.0.0", + + "ms": "^2.1.1", + +- "semver": "^7.3.8" + +- }, + +- "engines": { + +- "node": ">=12", + +- "npm": ">=6" + +- "semver": "^5.6.0" + +- }, + +- "engines": { + +- "node": ">=4", + +- "npm": ">=1.4.28" + + } + + }, + + “node_modules/jsonwebtoken/node_modules/semver”: { + +- "version": "7.7.3", + +- "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + +- "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + +- "version": "5.7.2", + +- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + +- "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + + "license": "ISC", + + "bin": { + +- "semver": "bin/semver.js" + +- }, + +- "engines": { + +- "node": ">=10" + +- "semver": "bin/semver" + + } + + }, + + “node_modules/jsqr”: { + +@@ -12367,30 +12610,30 @@ } + + }, + + "node_modules/jwa": { + +- "version": "1.4.2", + +- "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.2.tgz", + +- "integrity": "sha512-eeH5JO+21J78qMvTIDdBXidBd6nG2kZjg5Ohz/1fpa28Z4CcsWUzJ1ZZyFq/3z3N17aZy+ZuBoHljASbL1WfOw==", + +- "license": "MIT", + +- "dependencies": { + +- "buffer-equal-constant-time": "^1.0.1", + +- "version": "1.4.1", + +- "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.4.1.tgz", + +- "integrity": "sha512-qiLX/xhEEFKUAJ6FiBMbes3w9ATzyk5W7Hvzpa/SLYdxNtng+gcurvrI7TbACjIXlsJyr05/S1oUhZrc63evQA==", + +- "license": "MIT", + +- "dependencies": { + +- "buffer-equal-constant-time": "1.0.1", + + "ecdsa-sig-formatter": "1.0.11", + + "safe-buffer": "^5.0.1" + + } + + }, + + “node_modules/jws”: { + +- "version": "3.2.3", + +- "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.3.tgz", + +- "integrity": "sha512-byiJ0FLRdLdSVSReO/U4E7RoEyOCKnEnEPMjq3HxWtvzLsV08/i5RQKsFVNkCldrCaPr2vDNAOMsfs8T/Hze7g==", + +- "license": "MIT", + +- "dependencies": { + +- "jwa": "^1.4.2", + +- "version": "3.2.2", + +- "resolved": "https://registry.npmjs.org/jws/-/jws-3.2.2.tgz", + +- "integrity": "sha512-YHlZCB6lMTllWDtSPHz/ZXTsi8S00usEV6v1tjq8tOUZzw7DpSDWVXjXDre6ed1w/pd495ODpHZYSdkRTsa0HA==", + +- "license": "MIT", + +- "dependencies": { + +- "jwa": "^1.4.1", + + "safe-buffer": "^5.0.1" + + } + + }, + + “node_modules/kbpgp”: { + +- "version": "2.1.15", + +- "resolved": "https://registry.npmjs.org/kbpgp/-/kbpgp-2.1.15.tgz", + +- "integrity": "sha512-iFdQT+m2Mi2DB14kEFydF2joNe9x3E2VZCGZUt7UXsiZnQx5TtSl4KofP7EPtjHvf7weCxNKlEPSYiiCNMZ2jA==", + +- "version": "2.1.17", + +- "resolved": "https://registry.npmjs.org/kbpgp/-/kbpgp-2.1.17.tgz", + +- "integrity": "sha512-pnjH7amyg6dZLXyF42BKbCTST0l0r1ErunqtFRrJCkHkGJb83cZZmx1pnqNFr+d/ls+5gvcHrZLPfUG5q7oRYw==", + + "license": "BSD-3-Clause", + + "dependencies": { + + "bn": "^1.0.5", + +@@ -12673,6 +12916,18 @@ “dev”: true, + + "license": "MIT" + + }, + +- “node_modules/lodash.includes”: { + +- "version": "4.3.0", + +- "resolved": "https://registry.npmjs.org/lodash.includes/-/lodash.includes-4.3.0.tgz", + +- "integrity": "sha512-W3Bx6mdkRTGtlJISOvVD/lbqjTlPPUDTMnlXZFnVwi9NKJ6tiAk6LVdlhZMm17VZisqhKcgzpO5Wz91PCt5b0w==", + +- "license": "MIT" + +- }, + +- “node_modules/lodash.isboolean”: { + +- "version": "3.0.3", + +- "resolved": "https://registry.npmjs.org/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz", + +- "integrity": "sha512-Bz5mupy2SVbPHURB98VAcw+aHh4vRV5IPNhILUCsOzRmsTmSQ17jIuqopAentWoehktxGd9e/hbIXq980/1QJg==", + +- "license": "MIT" + +- }, + + “node_modules/lodash.isfinite”: { + + “version”: “3.3.2”, + + “resolved”: + “https://registry.npmjs.org/lodash.isfinite/-/lodash.isfinite-3.3.2.tgz”, + +@@ -12680,11 +12935,28 @@ “dev”: true, + + "license": "MIT" + + }, + +- “node_modules/lodash.isinteger”: { + +- "version": "4.0.4", + +- "resolved": "https://registry.npmjs.org/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz", + +- "integrity": "sha512-DBwtEWN2caHQ9/imiNeEA5ys1JoRtRfY3d7V9wkqtbycnAmTvRRmbHKDV4a0EYc678/dia0jrte4tjYwVBaZUA==", + +- "license": "MIT" + +- }, + +- “node_modules/lodash.isnumber”: { + +- "version": "3.0.3", + +- "resolved": "https://registry.npmjs.org/lodash.isnumber/-/lodash.isnumber-3.0.3.tgz", + +- "integrity": "sha512-QYqzpfwO3/CWf3XP+Z+tkQsfaLL/EnUlXWVkIk5FUPc4sBdTehEqZONuyRt2P67PXAk+NXmTBcc97zw9t1FQrw==", + +- "license": "MIT" + +- }, + + “node_modules/lodash.isplainobject”: { + + “version”: “4.0.6”, + + “resolved”: + “https://registry.npmjs.org/lodash.isplainobject/-/lodash.isplainobject-4.0.6.tgz”, + + “integrity”: + “sha512-oSXzaWypCMHkPC3NvBEaPHf0KsA5mvPrOPgQWDsbg8n7orZ290M0BmC/jgRZ4vcJ6DTAhjrsSYgdsW/F+MFOBA==”, + +- "dev": true, + +- "license": "MIT" + +- }, + +- “node_modules/lodash.isstring”: { + +- "version": "4.0.1", + +- "resolved": "https://registry.npmjs.org/lodash.isstring/-/lodash.isstring-4.0.1.tgz", + +- "integrity": "sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==", + + "license": "MIT" + + }, + + “node_modules/lodash.merge”: { + +@@ -12692,6 +12964,12 @@ “resolved”: +“https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz”, + + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + + "dev": true, + +- "license": "MIT" + +- }, + +- “node_modules/lodash.once”: { + +- "version": "4.1.1", + +- "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + +- "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + + "license": "MIT" + + }, + + “node_modules/lodash.union”: { + +@@ -13064,10 +13342,9 @@ } + + }, + + "node_modules/min-document": { + +- "version": "2.19.2", + +- "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.2.tgz", + +- "integrity": "sha512-8S5I8db/uZN8r9HSLFVWPdJCvYOejMcEC82VIzNUc6Zkklf/d1gg2psfE79/vyhWOj4+J8MtwmoOz3TmvaGu5A==", + +- "license": "MIT", + +- "version": "2.19.0", + +- "resolved": "https://registry.npmjs.org/min-document/-/min-document-2.19.0.tgz", + +- "integrity": "sha512-9Wy1B3m3f66bPPmU5hdA4DR4PB2OfDU/+GS3yAB7IQozE3tqXaVv2zOjgla7MEGSRv95+ILmOuvhLkOK6wJtCQ==", + + "dependencies": { + + "dom-walk": "^0.1.0" + + } + +@@ -13125,6 +13402,16 @@ “license”: “MIT”, + + "funding": { + + "url": "https://github.com/sponsors/ljharb" + +- } + +- }, + +- “node_modules/minipass”: { + +- "version": "7.1.2", + +- "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", + +- "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", + +- "dev": true, + +- "license": "ISC", + +- "engines": { + +- "node": ">=16 || 14 >=14.17" + + } + + }, + + “node_modules/mocha”: { + +@@ -13325,9 +13612,9 @@ } + + }, + + "node_modules/morgan": { + +- "version": "1.10.1", + +- "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.1.tgz", + +- "integrity": "sha512-223dMRJtI/l25dJKWpgij2cMtywuG/WiUKXdvwfbhGKBhy1puASqXwFzmWZ7+K73vUPoR7SS2Qz2cI/g9MKw0A==", + +- "version": "1.10.0", + +- "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.10.0.tgz", + +- "integrity": "sha512-AbegBVI4sh6El+1gNwvD5YIck7nSA36weD7xvIxG4in80j/UoK8AEGaWnnz8v1GxonMCltmlNs5ZKbGvl9b1XQ==", + + "dev": true, + + "license": "MIT", + + "dependencies": { + +@@ -13335,7 +13622,7 @@ “debug”: “2.6.9”, + + "depd": "~2.0.0", + + "on-finished": "~2.3.0", + +- "on-headers": "~1.1.0" + +- "on-headers": "~1.0.2" + + }, + + "engines": { + + "node": ">= 0.8.0" + +@@ -13832,6 +14119,19 @@ “integrity”: +“sha512-TKC/8zH5pXIAMVQio2TvVDTtPRX+DJPHDqjRbxogtFiByHyzKmy96RA0JtCQJ+WouyyL4A10xomQzgbUT+1jCg==”, + + "license": "MIT" + + }, + +- “node_modules/npm-run-path”: { + +- "version": "4.0.1", + +- "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + +- "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "path-key": "^3.0.0" + +- }, + +- "engines": { + +- "node": ">=8" + +- } + +- }, + + “node_modules/nth-check”: { + + “version”: “2.1.1”, + + “resolved”: + “https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz”, + +@@ -14005,9 +14305,9 @@ } + + }, + + "node_modules/on-headers": { + +- "version": "1.1.0", + +- "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.1.0.tgz", + +- "integrity": "sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==", + +- "version": "1.0.2", + +- "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + +- "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + + "dev": true, + + "license": "MIT", + + "engines": { + +@@ -14316,6 +14616,13 @@ “node”: “>= 14” + + } + + }, + +- “node_modules/package-json-from-dist”: { + +- "version": "1.0.1", + +- "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", + +- "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==", + +- "dev": true, + +- "license": "BlueOak-1.0.0" + +- }, + + “node_modules/pad-stream”: { + + “version”: “2.0.0”, + + “resolved”: + “https://registry.npmjs.org/pad-stream/-/pad-stream-2.0.0.tgz”, + +@@ -14568,6 +14875,30 @@ “node”: “>=0.10.0” + + } + + }, + +- “node_modules/path-scurry”: { + +- "version": "1.11.1", + +- "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", + +- "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", + +- "dev": true, + +- "license": "BlueOak-1.0.0", + +- "dependencies": { + +- "lru-cache": "^10.2.0", + +- "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" + +- }, + +- "engines": { + +- "node": ">=16 || 14 >=14.18" + +- }, + +- "funding": { + +- "url": "https://github.com/sponsors/isaacs" + +- } + +- }, + +- “node_modules/path-scurry/node_modules/lru-cache”: { + +- "version": "10.4.3", + +- "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + +- "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + +- "dev": true, + +- "license": "ISC" + +- }, + + “node_modules/path-to-regexp”: { + + “version”: “0.1.12”, + + “resolved”: + “https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.12.tgz”, + +@@ -14836,7 +15167,6 @@ “integrity”: +“sha512-Wb4p1J4zyFTbM+u6WuO4XstYx4Ky9Cewe4DWrel7B0w6VVICvPwdOpotjzcf6eD8TsckVnIMNONQyPIUFOUbCQ==”, + + "deprecated": "You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1", + + "license": "MIT", + +- "peer": true, + + "funding": { + + "type": "opencollective", + + "url": "https://opencollective.com/popperjs" + +@@ -14896,7 +15226,6 @@ } + + ], + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "nanoid": "^3.3.8", + + "picocolors": "^1.1.1", + +@@ -16034,7 +16363,6 @@ “integrity”: +“sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==”, + + "dev": true, + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "fast-deep-equal": "^3.1.3", + + "fast-uri": "^3.0.1", + +@@ -16891,6 +17219,45 @@ “node”: “>=8” + + } + + }, + +- “node_modules/string-width-cjs”: { + +- "name": "string-width", + +- "version": "4.2.3", + +- "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + +- "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "emoji-regex": "^8.0.0", + +- "is-fullwidth-code-point": "^3.0.0", + +- "strip-ansi": "^6.0.1" + +- }, + +- "engines": { + +- "node": ">=8" + +- } + +- }, + +- “node_modules/string-width-cjs/node_modules/ansi-regex”: { + +- "version": "5.0.1", + +- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + +- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + +- "dev": true, + +- "license": "MIT", + +- "engines": { + +- "node": ">=8" + +- } + +- }, + +- “node_modules/string-width-cjs/node_modules/strip-ansi”: { + +- "version": "6.0.1", + +- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + +- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "ansi-regex": "^5.0.1" + +- }, + +- "engines": { + +- "node": ">=8" + +- } + +- }, + + “node_modules/string-width/node_modules/ansi-regex”: { + + “version”: “5.0.1”, + + “resolved”: + “https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz”, + +@@ -16927,6 +17294,30 @@ “node”: “>=0.10.0” + + } + + }, + +- “node_modules/strip-ansi-cjs”: { + +- "name": "strip-ansi", + +- "version": "6.0.1", + +- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + +- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "ansi-regex": "^5.0.1" + +- }, + +- "engines": { + +- "node": ">=8" + +- } + +- }, + +- “node_modules/strip-ansi-cjs/node_modules/ansi-regex”: { + +- "version": "5.0.1", + +- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + +- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + +- "dev": true, + +- "license": "MIT", + +- "engines": { + +- "node": ">=8" + +- } + +- }, + + “node_modules/strip-comments”: { + + “version”: “2.0.1”, + + “resolved”: + “https://registry.npmjs.org/strip-comments/-/strip-comments-2.0.1.tgz”, + +@@ -16935,6 +17326,16 @@ “license”: “MIT”, + + "engines": { + + "node": ">=10" + +- } + +- }, + +- “node_modules/strip-final-newline”: { + +- "version": "2.0.0", + +- "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + +- "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + +- "dev": true, + +- "license": "MIT", + +- "engines": { + +- "node": ">=6" + + } + + }, + + “node_modules/strip-json-comments”: { + +@@ -17300,7 +17701,6 @@ “integrity”: +“sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==”, + + "dev": true, + + "license": "MIT", + +- "peer": true, + + "engines": { + + "node": ">=12" + + }, + +@@ -17309,9 +17709,9 @@ } + + }, + + "node_modules/tmp": { + +- "version": "0.2.5", + +- "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.5.tgz", + +- "integrity": "sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==", + +- "version": "0.2.3", + +- "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + +- "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + + "dev": true, + + "license": "MIT", + + "engines": { + +@@ -17462,8 +17862,7 @@ “resolved”: +“https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz”, + + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + + "dev": true, + +- "license": "0BSD", + +- "peer": true + +- "license": "0BSD" + + }, + + “node_modules/tweetnacl”: { + + "version": "0.13.3", + +@@ -17980,7 +18379,6 @@ “integrity”: +“sha512-EksG6gFY3L1eFMROS/7Wzgrii5mBAFe4rIr3r2BTfo7bcc+DWwFZ4OJ/miOuHJO/A85HwyI4eQ0F6IKXesO7Fg==”, + + "dev": true, + + "license": "MIT", + +- "peer": true, + + "dependencies": { + + "@types/eslint-scope": "^3.7.7", + + "@types/estree": "^1.0.6", + +@@ -18128,16 +18526,15 @@ } + + }, + + "node_modules/webpack-dev-server": { + +- "version": "5.2.1", + +- "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.2.1.tgz", + +- "integrity": "sha512-ml/0HIj9NLpVKOMq+SuBPLHcmbG+TGIjXRHsYfZwocUBIqEvws8NnS/V9AFQ5FKP+tgn5adwVwRrTEpGL33QFQ==", + +- "version": "5.0.4", + +- "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.0.4.tgz", + +- "integrity": "sha512-dljXhUgx3HqKP2d8J/fUMvhxGhzjeNVarDLcbO/EWMSgRizDkxHQDZQaLFL5VJY9tRBj2Gz+rvCEYYvhbqPHNA==", + + "dev": true, + + "license": "MIT", + + "dependencies": { + + "@types/bonjour": "^3.5.13", + + "@types/connect-history-api-fallback": "^1.5.4", + + "@types/express": "^4.17.21", + +- "@types/express-serve-static-core": "^4.17.21", + + "@types/serve-index": "^1.9.4", + + "@types/serve-static": "^1.15.5", + + "@types/sockjs": "^0.3.36", + +@@ -18148,20 +18545,23 @@ “colorette”: “^2.0.10”, + + "compression": "^1.7.4", + + "connect-history-api-fallback": "^2.0.0", + +- "express": "^4.21.2", + +- "default-gateway": "^6.0.3", + +- "express": "^4.17.3", + + "graceful-fs": "^4.2.6", + +- "http-proxy-middleware": "^2.0.7", + +- "html-entities": "^2.4.0", + +- "http-proxy-middleware": "^2.0.3", + + "ipaddr.js": "^2.1.0", + + "launch-editor": "^2.6.1", + + "open": "^10.0.3", + + "p-retry": "^6.2.0", + +- "rimraf": "^5.0.5", + + "schema-utils": "^4.2.0", + + "selfsigned": "^2.4.1", + + "serve-index": "^1.9.1", + + "sockjs": "^0.3.24", + + "spdy": "^4.0.2", + +- "webpack-dev-middleware": "^7.4.2", + +- "ws": "^8.18.0" + +- "webpack-dev-middleware": "^7.1.0", + +- "ws": "^8.16.0" + + }, + + "bin": { + + "webpack-dev-server": "bin/webpack-dev-server.js" + +@@ -18185,17 +18585,14 @@ } + + } + + }, + +- “node_modules/webpack-dev-server/node_modules/@types/express-serve-static-core”: + { + +- "version": "4.19.7", + +- "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.19.7.tgz", + +- "integrity": "sha512-FvPtiIf1LfhzsaIXhv/PHan/2FeQBbtBDtfX2QfvPxdUelMDEckK08SM6nqo1MIZY3RUlfA+HV8+hFUSio78qg==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "@types/node": "*", + +- "@types/qs": "*", + +- "@types/range-parser": "*", + +- "@types/send": "*" + +- “node_modules/webpack-dev-server/node_modules/brace-expansion”: { + +- "version": "2.0.1", + +- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + +- "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "balanced-match": "^1.0.0" + + } + + }, + + “node_modules/webpack-dev-server/node_modules/chokidar”: { + +@@ -18236,6 +18633,27 @@ “url”: +“https://github.com/sponsors/sindresorhus” + + } + + }, + +- “node_modules/webpack-dev-server/node_modules/glob”: { + +- "version": "10.4.5", + +- "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", + +- "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", + +- "dev": true, + +- "license": "ISC", + +- "dependencies": { + +- "foreground-child": "^3.1.0", + +- "jackspeak": "^3.1.2", + +- "minimatch": "^9.0.4", + +- "minipass": "^7.1.2", + +- "package-json-from-dist": "^1.0.0", + +- "path-scurry": "^1.11.1" + +- }, + +- "bin": { + +- "glob": "dist/esm/bin.mjs" + +- }, + +- "funding": { + +- "url": "https://github.com/sponsors/isaacs" + +- } + +- }, + + “node_modules/webpack-dev-server/node_modules/glob-parent”: { + + “version”: “5.1.2”, + + “resolved”: + “https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz”, + +@@ -18265,6 +18683,22 @@ “url”: +“https://github.com/sponsors/sindresorhus” + + } + + }, + +- “node_modules/webpack-dev-server/node_modules/minimatch”: { + +- "version": "9.0.5", + +- "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + +- "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + +- "dev": true, + +- "license": "ISC", + +- "dependencies": { + +- "brace-expansion": "^2.0.1" + +- }, + +- "engines": { + +- "node": ">=16 || 14 >=14.17" + +- }, + +- "funding": { + +- "url": "https://github.com/sponsors/isaacs" + +- } + +- }, + + “node_modules/webpack-dev-server/node_modules/open”: { + + “version”: “10.1.0”, + + “resolved”: “https://registry.npmjs.org/open/-/open-10.1.0.tgz”, + +@@ -18282,6 +18716,22 @@ }, + + "funding": { + + "url": "https://github.com/sponsors/sindresorhus" + +- } + +- }, + +- “node_modules/webpack-dev-server/node_modules/rimraf”: { + +- "version": "5.0.10", + +- "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-5.0.10.tgz", + +- "integrity": "sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==", + +- "dev": true, + +- "license": "ISC", + +- "dependencies": { + +- "glob": "^10.3.7" + +- }, + +- "bin": { + +- "rimraf": "dist/esm/bin.mjs" + +- }, + +- "funding": { + +- "url": "https://github.com/sponsors/isaacs" + + } + + }, + + “node_modules/webpack-node-externals”: { + +@@ -18640,6 +19090,64 @@ }, + + "funding": { + + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + +- } + +- }, + +- “node_modules/wrap-ansi-cjs”: { + +- "name": "wrap-ansi", + +- "version": "7.0.0", + +- "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + +- "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "ansi-styles": "^4.0.0", + +- "string-width": "^4.1.0", + +- "strip-ansi": "^6.0.0" + +- }, + +- "engines": { + +- "node": ">=10" + +- }, + +- "funding": { + +- "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + +- } + +- }, + +- “node_modules/wrap-ansi-cjs/node_modules/ansi-regex”: { + +- "version": "5.0.1", + +- "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + +- "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + +- "dev": true, + +- "license": "MIT", + +- "engines": { + +- "node": ">=8" + +- } + +- }, + +- “node_modules/wrap-ansi-cjs/node_modules/ansi-styles”: { + +- "version": "4.3.0", + +- "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + +- "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "color-convert": "^2.0.1" + +- }, + +- "engines": { + +- "node": ">=8" + +- }, + +- "funding": { + +- "url": "https://github.com/chalk/ansi-styles?sponsor=1" + +- } + +- }, + +- “node_modules/wrap-ansi-cjs/node_modules/strip-ansi”: { + +- "version": "6.0.1", + +- "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + +- "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + +- "dev": true, + +- "license": "MIT", + +- "dependencies": { + +- "ansi-regex": "^5.0.1" + +- }, + +- "engines": { + +- "node": ">=8" + + } + + }, + + “node_modules/wrap-ansi/node_modules/ansi-regex”: { + +CHANGED: package.json — mkilijanek/package.json +++ gchq/package.json @@ +-1,6 +1,6 @@ { + +“name”: “cyberchef”, + +- “version”: “10.19.4”, + +- “version”: “10.22.1”, + + “description”: “The Cyber Swiss Army Knife for encryption, encoding, + compression and data analysis.”, + + “author”: “n1474335 n1474335@gmail.com”, + + “homepage”: “https://gchq.github.io/CyberChef”, + +@@ -91,7 +91,7 @@ “terser”: “^5.31.1”, + + "webpack": "^5.91.0", + + "webpack-bundle-analyzer": "^4.10.2", + +- “webpack-dev-server”: “5.2.1”, + +- “webpack-dev-server”: “5.0.4”, + + “webpack-node-externals”: “^3.0.0”, + + “worker-loader”: “^3.0.8” + +}, + +@@ -117,7 +117,7 @@ “chi-squared”: “^1.1.0”, + + "codepage": "^1.15.0", + + "crypto-api": "^0.8.5", + +- “crypto-browserify”: “^3.12.0”, + +- “crypto-browserify”: “^3.12.1”, + + “crypto-js”: “^4.2.0”, + + “ctph.js”: “0.0.5”, + + “d3”: “7.9.0”, + +@@ -144,10 +144,10 @@ “json5”: “^2.2.3”, + + "jsonata": "^2.0.3", + + "jsonpath-plus": "^10.3.0", + +- “jsonwebtoken”: “9.0.0”, + +- “jsonwebtoken”: “8.5.1”, + + “jsqr”: “^1.4.0”, + + “jsrsasign”: “^11.1.0”, + +- “kbpgp”: “2.1.15”, + +- “kbpgp”: “^2.1.17”, + + “libbzip2-wasm”: “0.0.4”, + + “libyara-wasm”: “^1.2.1”, + + “lodash”: “^4.17.21”, + +@@ -202,14 +202,9 @@ “lint:grammar”: “cspell ./src”, + + "postinstall": "npx grunt exec:fixCryptoApiImports && npx grunt exec:fixSnackbarMarkup && npx grunt exec:fixJimpModule", + + "newop": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newOperation.mjs", + +- “minor”: “node –experimental-modules –experimental-json-modules + src/core/config/scripts/newMinorVersion.mjs”, + +- “minor”: “node –experimental-modules –experimental-json-modules + src/core/config/scripts/newMinorVersion.mjs && npm version minor + –git-tag-version=false && echo "Updated to version v$(npm pkg get + version | xargs), please create a pull request and once merged use + ‘npm run tag’"”, + +- “tag”: “git tag -s "v$(npm pkg get version | xargs)\" -m \"$(npm pkg + get version | xargs)" && echo "Created v$(npm pkg get version | + xargs), now check and push the tag"”, + + “getheapsize”: “node -e + ‘console.log(node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb)’”, + +- “setheapsize”: “export NODE_OPTIONS=–max_old_space_size=2048”, + +- “security:audit”: “npm audit”, + +- “security:audit:json”: “npm audit –json”, + +- “security:fix”: “./scripts/security-fix.sh”, + +- “security:triage”: “node scripts/vulnerability-triage.js”, + +- “security:triage:json”: “node scripts/vulnerability-triage.js + –json”, + +- “security:check”: “npm run security:triage && npm run lint” + +- “setheapsize”: “export NODE_OPTIONS=–max_old_space_size=2048” + +} + +} + +REMOVED in gchq (exists in mkilijanek): scripts/security-fix.sh REMOVED +in gchq (exists in mkilijanek): scripts/vulnerability-triage.js + +CHANGED: src/core/Utils.mjs — mkilijanek/src/core/Utils.mjs +++ +gchq/src/core/Utils.mjs @@ -177,7 +177,7 @@ */ + + static printable(str, preserveWs=false, onlyAscii=false) { + + if (onlyAscii) { + +- return str.replace(/[^\x20-\x7f]/g, "."); + +- return str.replace(/[^\x20-\x7e]/g, "."); + + } + + + + // eslint-disable-next-line no-misleading-character-class + +CHANGED: src/core/config/Categories.json — +mkilijanek/src/core/config/Categories.json +++ +gchq/src/core/config/Categories.json @@ -26,6 +26,8 @@ “From Base45”, + + "To Base58", + + "From Base58", + +- "To Bech32", + +- "From Bech32", + + "To Base62", + + "From Base62", + + "To Base64", + +CHANGED: src/core/config/scripts/newMinorVersion.mjs — +mkilijanek/src/core/config/scripts/newMinorVersion.mjs +++ +gchq/src/core/config/scripts/newMinorVersion.mjs @@ -7,138 +7,197 @@ */ + +/* eslint no-console: [“off”] */ + +- + +-import prompt from “prompt”; + +-import colors from “colors”; + ++/* eslint jsdoc/require-jsdoc: [“off”] */ + +- import path from “path”; + +-import fs from “fs”; + ++import fs from “fs”; + +import process from “process”; + +- + +-const dir = path.join(process.cwd() + “/src/core/config/”); + +-if (!fs.existsSync(dir)) { + +- console.log(“:” + process.cwd()); + +- console.log(“Error: newMinorVersion.mjs should be run from the + project root”); + +- console.log(“Example> node –experimental-modules + src/core/config/scripts/newMinorVersion.mjs”); + +- process.exit(1); + ++import { execSync } from “child_process”; + +- + ++const ignoredAuthors = [“github-advanced-security[bot]”, +“dependabot[bot]”]; + +- + ++async function main() { + +- const dir = path.join(process.cwd() + “/src/core/config/”); + +- if (!fs.existsSync(dir)) { + +- console.log("\nCWD: " + process.cwd()); + +- console.log( + +- "Error: newMinorVersion.mjs should be run from the project root", + +- ); + +- console.log( + +- "Example> node --experimental-modules src/core/config/scripts/newMinorVersion.mjs", + +- ); + +- process.exit(1); + +- } + +- + +- let changelogData = fs.readFileSync( + +- path.join(process.cwd(), "CHANGELOG.md"), + +- "utf8", + +- ); + +- const lastVersion = changelogData.match( + +- /## Details\s+### \[(\d+)\.(\d+)\.(\d+)\]/, + +- ); + +- const newVersion = [ + +- parseInt(lastVersion[1], 10), + +- parseInt(lastVersion[2], 10) + 1, + +- 0, + +- ]; + +- + +- let knownContributors = changelogData.match(/^[@([^\]]+)]/gm); + +- knownContributors = knownContributors.map((c) => c.slice(2, -1)); + +- + +- const date = new Date().toISOString().split(“T”)[0]; + +- + +- const lastVersionSha = execSync( + +- `git rev-list -n 1 v${lastVersion[1]}.${lastVersion[2]}.${lastVersion[3]}`, + +- { + +- encoding: "utf8", + +- }, + +- ).trim(); + +- if (lastVersionSha.length !== 40) { + +- throw new Error( + +- `Unexpected output from git rev-list: ${lastVersionSha}`, + +- ); + +- } + +- + +- const features = []; + +- + +- const commits = await ( + +- await fetch(`https://api.github.com/repos/gchq/cyberchef/commits`) + +- ).json(); + +- let foundLast = false; + +- for (const commit of commits) { + +- if (commit.sha === lastVersionSha) { + +- foundLast = true; + +- break; + +- } else { + +- const feature = { + +- message: "", + +- authors: [], + +- id: "", + +- }; + +- + +- const msgparts = commit.commit.message.split("\n\n"); + +- feature.message = msgparts[0]; + +- const prIdMatch = feature.message.match(/\(#(\d+)\)$/); + +- if (prIdMatch !== null) { + +- feature.message = feature.message + +- .replace(prIdMatch[0], "") + +- .trim(); + +- feature.id = prIdMatch[1]; + +- } + +- + +- if (!ignoredAuthors.includes(commit.author.login)) { + +- feature.authors.push(commit.author.login); + +- } + +- + +- if (msgparts.length > 1) { + +- msgparts[1] + +- .split("\n") + +- .filter((line) => line.startsWith("Co-authored-by: ")) + +- .forEach((line) => { + +- let coAuthor = line.slice("Co-authored-by: ".length); + +- if (coAuthor.indexOf(">") !== -1) { + +- const email = coAuthor.slice( + +- coAuthor.indexOf("<") + 1, + +- coAuthor.indexOf(">"), + +- ); + +- if (email.endsWith("@users.noreply.github.com")) { + +- coAuthor = email.slice( + +- email.indexOf("+") + 1, + +- -"@users.noreply.github.com".length, + +- ); + +- } else { + +- throw new Error( + +- "Could not get ID of co-author: " + + +- coAuthor, + +- ); + +- } + +- } else { + +- throw new Error( + +- "Could not get email of co-author: " + coAuthor, + +- ); + +- } + +- if (!ignoredAuthors.includes(coAuthor)) { + +- feature.authors.push(coAuthor); + +- } + +- }); + +- } + +- + +- features.push(feature); + +- } + +- } + +- if (!foundLast) { + +- throw new Error( + +- `Could not find last version commit: ${lastVersionSha} - need to add paging functionality`, + +- ); + +- } + +- + +- let message = + ### [${newVersion[0]}.${newVersion[1]}.${newVersion[2]}] - ${date}\n; + +- + +- const authors = []; + +- const prIDs = []; + +- const commitIDs = []; + +- + +- features.forEach((feature) => { + +- const id = + +- feature.id.length > 10 ? feature.id.slice(0, 7) : "#" + feature.id; + +- message += `- ${feature.message} ${feature.authors.map((a) => `[@${a}]`).join(" ")} | [${id}]\n`; + +- + +- feature.authors.forEach((author) => { + +- if (!knownContributors.includes(author)) { + +- knownContributors.push(author); + +- authors.push(`[@${author}]: https://github.com/${author}`); + +- } + +- }); + +- + +- if (feature.id.length > 10) { + +- commitIDs.push( + +- `[${id}]: https://github.com/gchq/CyberChef/commit/${feature.id}`, + +- ); + +- } else { + +- prIDs.push( + +- `[#${feature.id}]: https://github.com/gchq/CyberChef/pull/${feature.id}`, + +- ); + +- } + +- }); + +- + +- // Message + +- changelogData = changelogData.replace( + +- /## Details\n\n/, + +- "## Details\n\n" + message + "\n", + +- ); + +- + +- // Tag + +- const newTag = + [${newVersion[0]}.${newVersion[1]}.${newVersion[2]}]: https://github.com/gchq/CyberChef/releases/tag/v${newVersion[0]}.${newVersion[1]}.${newVersion[2]}\n; + +- changelogData = changelogData.replace( + +- /\n\n(\[\d+\.\d+\.\d+\]: https)/, + +- "\n\n" + newTag + "$1", + +- ); + +- + +- // Author + +- authors.forEach((author) => { + +- changelogData = changelogData.replace( + +- /(\n\[@[^\]]+\]: https:\/\/github\.com\/[^\n]+\n)\n/, + +- "$1" + author + "\n\n", + +- ); + +- }); + +- + +- // Commit IDs + +- commitIDs.forEach((commitID) => { + +- changelogData = changelogData.replace( + +- /(\n\[[^\].]+\]: https:\/\/github.com\/gchq\/CyberChef\/commit\/[^\n]+\n)\n/, + +- "$1" + commitID + "\n\n", + +- ); + +- }); + +- + +- // PR IDs + +- prIDs.forEach((prID) => { + +- changelogData = changelogData.replace( + +- /(\n\[#[^\]]+\]: https:\/\/github.com\/gchq\/CyberChef\/(?:pull|issues)\/[^\n]+\n)\n*$/, + +- "$1" + prID + "\n\n", + +- ); + +- }); + +- + +- fs.writeFileSync(path.join(process.cwd(), “CHANGELOG.md”), + changelogData); + +} + +- + +-let changelogData = fs.readFileSync(path.join(process.cwd(), +“CHANGELOG.md”), “utf8”); + +-const lastVersion = changelogData.match(/## Details+### [().().()]/); + +-const newVersion = []; + +- + +-let knownContributors = changelogData.match(/^[@([^\]]+)]/gm); + +-knownContributors = knownContributors.map(c => c.slice(2, -1)); + +- + +-const date = (new Date()).toISOString().split(“T”)[0]; + +- + +-const schema = { + +- properties: { + +- message: { + +- description: "A short but descriptive summary of a feature in this version", + +- example: "Added 'Op name' operation", + +- prompt: "Feature description", + +- type: "string", + +- required: true, + +- }, + +- author: { + +- description: "The author of the feature (only one supported, edit manually to add more)", + +- example: "n1474335", + +- prompt: "Author", + +- type: "string", + +- default: "n1474335" + +- }, + +- id: { + +- description: "The PR number or full commit hash for this feature.", + +- example: "1200", + +- prompt: "Pull request or commit ID", + +- type: "string" + +- }, + +- another: { + +- description: "y/n", + +- example: "y", + +- prompt: "Add another feature?", + +- type: "string", + +- pattern: /^[yn]$/, + +- } + +- } + +-}; + +- + +-// Build schema + +-for (const prop in schema.properties) { + +- const p = schema.properties[prop]; + +- p.description = “” + colors.white(p.description) + colors.cyan(“:” + + p.example) + “” + colors.green(p.prompt); + +-} + +- + +-prompt.message = ““; + +-prompt.delimiter = “:”.green; + +- + +-const features = []; + +-const authors = []; + +-const prIDs = []; + +-const commitIDs = []; + +- + +-prompt.start(); + +- + +-const getFeature = function() { + +- prompt.get(schema, (err, result) => { + +- if (err) { + +- console.log("\nExiting script."); + +- process.exit(0); + +- } + +- + +- features.push(result); + +- + +- if (result.another === "y") { + +- getFeature(); + +- } else { + +- let message = `### [${newVersion[0]}.${newVersion[1]}.${newVersion[2]}] - ${date}\n`; + +- + +- features.forEach(feature => { + +- const id = feature.id.length > 10 ? feature.id.slice(0, 7) : "#" + feature.id; + +- message += `- ${feature.message} [@${feature.author}] | [${id}]\n`; + +- + +- if (!knownContributors.includes(feature.author)) { + +- authors.push(`[@${feature.author}]: https://github.com/${feature.author}`); + +- } + +- + +- if (feature.id.length > 10) { + +- commitIDs.push(`[${id}]: https://github.com/gchq/CyberChef/commit/${feature.id}`); + +- } else { + +- prIDs.push(`[#${feature.id}]: https://github.com/gchq/CyberChef/pull/${feature.id}`); + +- } + +- }); + +- + +- // Message + +- changelogData = changelogData.replace(/## Details\n\n/, "## Details\n\n" + message + "\n"); + +- + +- // Tag + +- const newTag = `[${newVersion[0]}.${newVersion[1]}.${newVersion[2]}]: https://github.com/gchq/CyberChef/releases/tag/v${newVersion[0]}.${newVersion[1]}.${newVersion[2]}\n`; + +- changelogData = changelogData.replace(/\n\n(\[\d+\.\d+\.\d+\]: https)/, "\n\n" + newTag + "$1"); + +- + +- // Author + +- authors.forEach(author => { + +- changelogData = changelogData.replace(/(\n\[@[^\]]+\]: https:\/\/github\.com\/[^\n]+\n)\n/, "$1" + author + "\n\n"); + +- }); + +- + +- // Commit IDs + +- commitIDs.forEach(commitID => { + +- changelogData = changelogData.replace(/(\n\[[^\].]+\]: https:\/\/github.com\/gchq\/CyberChef\/commit\/[^\n]+\n)\n/, "$1" + commitID + "\n\n"); + +- }); + +- + +- // PR IDs + +- prIDs.forEach(prID => { + +- changelogData = changelogData.replace(/(\n\[#[^\]]+\]: https:\/\/github.com\/gchq\/CyberChef\/pull\/[^\n]+\n)\n*$/, "$1" + prID + "\n\n"); + +- }); + +- + +- fs.writeFileSync(path.join(process.cwd(), "CHANGELOG.md"), changelogData); + +- + +- console.log("Written CHANGELOG.md\nCommit changes and then run `npm version minor`."); + +- } + +- }); + +-}; + +- + +-getFeature(); + ++main().catch(console.error); + +ADDED in gchq (missing in mkilijanek): src/core/lib/Bech32.mjs + +CHANGED: src/core/lib/Hex.mjs — mkilijanek/src/core/lib/Hex.mjs +++ +gchq/src/core/lib/Hex.mjs @@ -33,7 +33,7 @@ if (data instanceof +ArrayBuffer) data = new Uint8Array(data); + + let output = ""; + +- const prepend = (delim === “0x” || delim === “\x”); + +- const prepend = (delim === “0x” || delim === “\x” || delim === “%”); + + for (let i = 0; i < data.length; i++) { + + const hex = data[i].toString(16).padStart(padding, "0"); + +CHANGED: src/core/lib/JA4.mjs — mkilijanek/src/core/lib/JA4.mjs +++ +gchq/src/core/lib/JA4.mjs @@ -91,9 +91,7 @@ let alpn = “00”; + + for (const ext of tlsr.handshake.value.extensions.value) { + + if (ext.type.value === "application_layer_protocol_negotiation") { + +- alpn = parseFirstALPNValue(ext.value.data); + +- alpn = alpn.charAt(0) + alpn.charAt(alpn.length - 1); + +- if (alpn.charCodeAt(0) > 127) alpn = "99"; + +- alpn = alpnFingerprint(parseFirstALPNValue(ext.value.data)); + + break; + + } + + } + +@@ -212,9 +210,7 @@ let alpn = “00”; + + for (const ext of tlsr.handshake.value.extensions.value) { + + if (ext.type.value === "application_layer_protocol_negotiation") { + +- alpn = parseFirstALPNValue(ext.value.data); + +- alpn = alpn.charAt(0) + alpn.charAt(alpn.length - 1); + +- if (alpn.charCodeAt(0) > 127) alpn = "99"; + +- alpn = alpnFingerprint(parseFirstALPNValue(ext.value.data)); + + break; + + } + + } + +@@ -262,3 +258,33 @@ default: return “00”; // Unknown + + } + +} + +- + ++/** + +- - Checks if a byte is ASCII alphanumeric (0-9, A-Z, a-z). + +- - @param {number} byte + +- - @returns {boolean} + +- */ + ++function isAlphanumeric(byte) { + +- return (byte >= 0x30 && byte <= 0x39) || + +- (byte >= 0x41 && byte <= 0x5A) || + +- (byte >= 0x61 && byte <= 0x7A); + ++} + +- + ++/** + +- - Computes the 2-character ALPN fingerprint from raw ALPN bytes. + +- - If both first and last bytes are ASCII alphanumeric, returns + their characters. + +- - Otherwise, returns first hex digit of first byte + last hex + digit of last byte. + +- - @param {Uint8Array|null} rawBytes + +- - @returns {string} + +- */ + ++function alpnFingerprint(rawBytes) { + +- if (!rawBytes || rawBytes.length === 0) return “00”; + +- const firstByte = rawBytes[0]; + +- const lastByte = rawBytes[rawBytes.length - 1]; + +- if (isAlphanumeric(firstByte) && isAlphanumeric(lastByte)) { + +- return String.fromCharCode(firstByte) + String.fromCharCode(lastByte); + +- } + +- const firstHex = firstByte.toString(16).padStart(2, “0”); + +- const lastHex = lastByte.toString(16).padStart(2, “0”); + +- return firstHex[0] + lastHex[1]; + ++} + +CHANGED: src/core/lib/LS47.mjs — mkilijanek/src/core/lib/LS47.mjs +++ +gchq/src/core/lib/LS47.mjs @@ -223,19 +223,8 @@ initTiles(); + + checkKey(key); + + let padding = ""; + +- + +- // Use cryptographically secure random if available, otherwise + fallback to Math.random + +- const getSecureRandom = () => { + +- if (typeof crypto !== "undefined" && crypto.getRandomValues) { + +- const array = new Uint32Array(1); + +- crypto.getRandomValues(array); + +- return array[0] / (0xFFFFFFFF + 1); + +- } + +- return Math.random(); + +- }; + +- for (let i = 0; i < paddingSize; i++) { + +- padding += letters.charAt(Math.floor(getSecureRandom() * letters.length)); + +- padding += letters.charAt(Math.floor(Math.random() * letters.length)); + + } + + return encrypt(key, padding+plaintext+“—”+signature); + +} + +CHANGED: src/core/lib/TLS.mjs — mkilijanek/src/core/lib/TLS.mjs +++ +gchq/src/core/lib/TLS.mjs @@ -247,7 +247,7 @@ description: “Selected +Compression Method”, + + length: 1, + + data: b.getBytes(1), + +- value: COMPRESSION_METHODS_LOOKUP[s.readInt(1)] || "Unknown" + +- value: s.readInt(1) // TODO: Compression method name here + + }; + + // Extensions Length + +@@ -303,7 +303,7 @@ description: “Compression Method”, + + length: 1, + + data: b.getBytes(1), + +- value: COMPRESSION_METHODS_LOOKUP[s.readInt(1)] || "Unknown" + +- value: s.readInt(1) // TODO: Compression method name here + + }); + + } + + return cm; + +@@ -837,15 +837,6 @@ ]; + +/** + +- - Compression methods lookup table + +- */ + +-const COMPRESSION_METHODS_LOOKUP = { + +- 0: “null”, + +- 1: “DEFLATE”, + +- 64: “LZS” + +-}; + +- + +-/** + +- Parses the supported_versions extension and returns the highest + supported version. + +- @param {Uint8Array} bytes + +- @returns {number} + +@@ -872,15 +863,15 @@ } + +/** + +- - Parses the application_layer_protocol_negotiation extension and + returns the first value. + +- - Parses the application_layer_protocol_negotiation extension and + returns the first value as raw bytes. + + - @param {Uint8Array} bytes + +- - @returns {number} + +- - @returns {Uint8Array|null} + + */ + +export function parseFirstALPNValue(bytes) { + + const s = new Stream(bytes); + + const alpnExtLen = s.readInt(2); + +- if (alpnExtLen < 3) return “00”; + +- if (alpnExtLen < 2) return null; + + const strLen = s.readInt(1); + +- if (strLen < 2) return “00”; + +- return s.readString(strLen); + +- if (strLen < 1) return null; + +- return s.getBytes(strLen); + +} + +ADDED in gchq (missing in mkilijanek): +src/core/operations/FromBech32.mjs + +CHANGED: src/core/operations/FromHexdump.mjs — +mkilijanek/src/core/operations/FromHexdump.mjs +++ +gchq/src/core/operations/FromHexdump.mjs @@ -43,7 +43,7 @@ */ + + run(input, args) { + + const output = [], + +- regex = /^\s*(?:[\dA-F]{4,16}h?:?)?[ \t]+((?:[\dA-F]{2} ){1,8}(?:[ \t]|[\dA-F]{2}-)(?:[\dA-F]{2} ){1,8}|(?:[\dA-F]{4} )*[\dA-F]{4}|(?:[\dA-F]{2} )*[\dA-F]{2})/igm; + +- regex = /^\s*(?:[\dA-F]{4,16}h?:?)?[ \t]+((?:[\dA-F]{2} ){1,8}(?:[ \t]|[\dA-F]{2}-)(?:[\dA-F]{2} ){1,8}|(?:[\dA-F]{4} )+(?:[\dA-F]{2})?|(?:[\dA-F]{2} )*[\dA-F]{2})/igm; + + let block, line; + + + + while ((block = regex.exec(input))) { + +CHANGED: src/core/operations/FromQuotedPrintable.mjs — +mkilijanek/src/core/operations/FromQuotedPrintable.mjs +++ +gchq/src/core/operations/FromQuotedPrintable.mjs @@ -23,7 +23,7 @@ + + this.name = "From Quoted Printable"; + + this.module = "Default"; + +- this.description = "Converts QP-encoded text back to standard text.

e.g. The quoted-printable encoded string hello=20world becomes hello world"; + +- this.description = "Converts QP-encoded text back to standard text. This format is a content transfer encoding common in email messages.

e.g. The quoted-printable encoded string hello=20world becomes hello world"; + + this.infoURL = "https://wikipedia.org/wiki/Quoted-printable"; + + this.inputType = "string"; + + this.outputType = "byteArray"; + +CHANGED: src/core/operations/ToBase85.mjs — +mkilijanek/src/core/operations/ToBase85.mjs +++ +gchq/src/core/operations/ToBase85.mjs @@ -33,7 +33,7 @@ value: +ALPHABET_OPTIONS + + }, + + { + +- name: "Include delimeter", + +- name: "Include delimiter", + + type: "boolean", + + value: false + + } + +ADDED in gchq (missing in mkilijanek): src/core/operations/ToBech32.mjs + +CHANGED: src/core/operations/ToQuotedPrintable.mjs — +mkilijanek/src/core/operations/ToQuotedPrintable.mjs +++ +gchq/src/core/operations/ToQuotedPrintable.mjs @@ -23,7 +23,7 @@ + + this.name = "To Quoted Printable"; + + this.module = "Default"; + +- this.description = "Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in e-mail.

QP works by using the equals sign '=' as an escape character. It also limits line length to 76, as some software has limits on line length."; + +- this.description = "Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in email.

QP works by using the equals sign '=' as an escape character. It also limits line length to 76, as some software has limits on line length."; + + this.infoURL = "https://wikipedia.org/wiki/Quoted-printable"; + + this.inputType = "ArrayBuffer"; + + this.outputType = "string"; + +CHANGED: src/core/vendor/gost/gostRandom.mjs — +mkilijanek/src/core/vendor/gost/gostRandom.mjs +++ +gchq/src/core/vendor/gost/gostRandom.mjs @@ -114,10 +114,7 @@ // Native +window cryptographic interface + + rootCrypto.getRandomValues(u8); + + } else { + +- // Standard Javascript method - WARNING: Not cryptographically secure! + +- if (typeof console !== "undefined" && console.warn) { + +- console.warn("SECURITY WARNING: crypto.getRandomValues not available, falling back to Math.random() which is NOT cryptographically secure!"); + +- } + +- // Standard Javascript method + + for (var i = 0, n = u8.length; i < n; i++) + + u8[i] = Math.floor(256 * Math.random()) & 255; + + } + +CHANGED: src/node/apiUtils.mjs — mkilijanek/src/node/apiUtils.mjs +++ +gchq/src/node/apiUtils.mjs @@ -66,7 +66,7 @@ * @param str + +*/ + +export function sanitise(str) { + +- return str.replace(/ /g, ““).toLowerCase(); + +- return str.replace(/[/.-]/g, ““).toLowerCase(); + +} + +CHANGED: src/web/App.mjs — mkilijanek/src/web/App.mjs +++ +gchq/src/web/App.mjs @@ -650,7 +650,7 @@ + + // const compareURL = `https://github.com/gchq/CyberChef/compare/v${prev.join(".")}...v${PKG_VERSION}`; + +- let compileInfo = `Last build: ${timeSinceCompile.substr(0, 1).toUpperCase() + timeSinceCompile.substr(1)} ago`; + +- let compileInfo = `Last build: ${timeSinceCompile.substring(0, 1).toUpperCase() + timeSinceCompile.substring(1)} ago`; + + + + if (window.compileMessage !== "") { + + compileInfo += " - " + window.compileMessage; + +CHANGED: src/web/static/sitemap.mjs — +mkilijanek/src/web/static/sitemap.mjs +++ +gchq/src/web/static/sitemap.mjs @@ -1,6 +1,5 @@ import sm from +“sitemap”; + +-import OperationConfig from “../../core/config/OperationConfig.json” +assert {type: “json”}; + +- + ++import OperationConfig from “../../core/config/OperationConfig.json” +assert { type: “json” }; + +/** + +- Generates an XML sitemap for all CyberChef operations and a number + of recipes. + +@@ -10,25 +9,25 @@ * @license Apache-2.0 + +*/ + +-const smStream = new sm.SitemapStream({ + +- hostname: “https://gchq.github.io/CyberChef”, + +-}); + ++const baseUrl = “https://gchq.github.io/CyberChef/”; + +- + ++const smStream = new sm.SitemapStream({}); + +smStream.write({ + +- url: “/”, + +- url: baseUrl, + + changefreq: “weekly”, + +- priority: 1.0 + +- priority: 1.0, + +}); + +for (const op in OperationConfig) { + + smStream.write({ + +- url: `/?op=${encodeURIComponent(op)}`, + +- url: `${baseUrl}?op=${encodeURIComponent(op)}`, + + changeFreq: "yearly", + +- priority: 0.5 + +- priority: 0.5, + + }); + +} + +smStream.end(); + +sm.streamToPromise(smStream).then( + +- buffer => console.log(buffer.toString()) // eslint-disable-line + no-console + +- (buffer) => console.log(buffer.toString()), // eslint-disable-line + no-console + +); + +CHANGED: src/web/waiters/InputWaiter.mjs — +mkilijanek/src/web/waiters/InputWaiter.mjs +++ +gchq/src/web/waiters/InputWaiter.mjs @@ -151,8 +151,20 @@ // Event +handlers + + EditorView.domEventHandlers({ + + paste(event, view) { + +- const clipboardData = event.clipboardData; + +- const items = clipboardData.items; + +- const files = []; + +- for (let i = 0; i < items.length; i++) { + +- const item = items[i]; + +- if (item.kind === "file") { + +- const file = item.getAsFile(); + +- files.push(file); + +- + +- event.preventDefault(); // Prevent the default paste behavior + +- } + +- } + + setTimeout(() => { + +- self.afterPaste(event); + +- self.afterPaste(files); + + }); + + } + + }) + +@@ -914,9 +926,12 @@ * Handler that fires just after input paste events. + + * Checks whether the EOL separator or character encoding should be updated. + + * + +- * @param {event} e + +- */ + +- afterPaste(e) { + +- * @param {File[]} files - An array of any files that were included in the paste event + +- */ + +- afterPaste(files) { + +- if (files.length > 0) { + +- this.loadUIFiles(files); + +- } + + // If EOL has been fixed, skip this. + + if (this.eolState > 1) return; + +CHANGED: src/web/workers/DishWorker.mjs — +mkilijanek/src/web/workers/DishWorker.mjs +++ +gchq/src/web/workers/DishWorker.mjs @@ -7,6 +7,8 @@ */ + +import Dish from “../../core/Dish.mjs”; + ++import DishError from “../../core/errors/DishError.mjs”; + ++import { CHR_ENC_SIMPLE_REVERSE_LOOKUP } from +“../../core/lib/ChrEnc.mjs”; + +import Utils from “../../core/Utils.mjs”; + +import cptable from “codepage”; + +import loglevelMessagePrefix from “loglevel-message-prefix”; + +@@ -98,7 +100,7 @@ try { + + str = cptable.utils.decode(data.encoding, new Uint8Array(data.buffer)); + + } catch (err) { + +- str = err; + +- str = new DishError(`Error decoding buffer with encoding ${CHR_ENC_SIMPLE_REVERSE_LOOKUP[data.encoding]}: ${err.message}`).toString(); + + } + + } + +CHANGED: tests/node/tests/Utils.mjs — +mkilijanek/tests/node/tests/Utils.mjs +++ +gchq/tests/node/tests/Utils.mjs @@ -20,4 +20,10 @@ +assert.equal(Utils.parseEscapedChars(“\\\‘“),”\’”); + + }), + +- it(“Utils: should replace delete character”, () => { + +- assert.equal( + +- Utils.printable("\x7e\x7f\x80\xa7", false, true), + +- "\x7e...", + +- ); + +- }), + +]); + +CHANGED: tests/node/tests/nodeApi.mjs — +mkilijanek/tests/node/tests/nodeApi.mjs +++ +gchq/tests/node/tests/nodeApi.mjs @@ -343,6 +343,42 @@ “args”: [false] } + + ]); + + assert.strictEqual(result.toString(), "begin_something_aaaaaaaaaaaaaa_end_something"); + +- }), + +- + +- it(“chef.bake: should accept operation names from Chef Website which + contain forward slash”, () => { + +- const result = chef.bake("I'll have the test salmon", [ + +- { "op": "Find / Replace", + +- "args": [{ "option": "Regex", "string": "test" }, "good", true, false, true, false]} + +- ]); + +- assert.strictEqual(result.toString(), "I'll have the good salmon"); + +- }), + +- + +- it(“chef.bake: should accept operation names from Chef Website which + contain a hyphen”, () => { + +- const result = chef.bake("I'll have the test salmon", [ + +- { "op": "Adler-32 Checksum", + +- "args": [] } + +- ]); + +- assert.strictEqual(result.toString(), "6e4208f8"); + +- }), + +- + +- it(“chef.bake: should accept operation names from Chef Website which + contain a period”, () => { + +- const result = chef.bake("30 13 02 01 05 16 0e 41 6e 79 62 6f 64 79 20 74 68 65 72 65 3f", [ + +- { "op": "Parse ASN.1 hex string", + +- "args": [0, 32] } + +- ]); + +- assert.strictEqual(result.toString(), `SEQUENCE + +- INTEGER 05 + +- IA5String ‘Anybody there?’ + ++`); + +- }), + +- + +- it(“Excluded operations: throw a sensible error when you try and + call one”, () => { + +- try { + +- chef.fork(); + +- } catch (e) { + +- assert.strictEqual(e.type, "ExcludedOperationError"); + +- assert.strictEqual(e.message, "Sorry, the Fork operation is not available in the Node.js version of CyberChef."); + +- } + + }), + + it(“chef.bake: cannot accept flowControl operations in recipe”, () + => { + +CHANGED: tests/operations/index.mjs — +mkilijanek/tests/operations/index.mjs +++ +gchq/tests/operations/index.mjs @@ -26,6 +26,7 @@ import +“./tests/Base85.mjs”; + +import “./tests/Base92.mjs”; + +import “./tests/BCD.mjs”; + ++import “./tests/Bech32.mjs”; + +import “./tests/BitwiseOp.mjs”; + +import “./tests/BLAKE2b.mjs”; + +import “./tests/BLAKE2s.mjs”; + +ADDED in gchq (missing in mkilijanek): tests/operations/tests/Bech32.mjs + +CHANGED: tests/operations/tests/Code.mjs — +mkilijanek/tests/operations/tests/Code.mjs +++ +gchq/tests/operations/tests/Code.mjs @@ -322,8 +322,21 @@ ] + + } + + ], + +- expectedMatch: /^Invalid JPath expression: jsonPath: self is not defined:/ + +- }, + +- expectedMatch: /^Invalid JPath expression: Unexpected "{" at character 1/ + +- }, + +- { + +- name: "JPath Expression: Script-based RCE", + +- input: "[{}]", + +- recipeConfig: [ + +- { + +- "op": "JPath expression", + +- "args": [ + +- "$..[?(p=\"console.log(this.process.mainModule.require('child_process').execSync('id').toString())\";a=''[['constructor']][['constructor']](p);a())]", + +- "\n" + +- ] + +- } + +- ], + +- expectedMatch: /^Invalid JPath expression: jsonPath: Cannot read properties of {2}\(reading 'constructor'\): / }, + + { + + name: "CSS selector", + + input: '
\n

hello

\n

world

\n

again

\n
', + +CHANGED: tests/operations/tests/Hex.mjs — +mkilijanek/tests/operations/tests/Hex.mjs +++ +gchq/tests/operations/tests/Hex.mjs @@ -38,6 +38,20 @@ “op”: “To Hex”, + + "args": [ + + "0x with comma", + +- 0 + +- ] + +- } + +- ] + +- }, + +- { + +- name: "ASCII to Hex with percent deliminator", + +- input: "aberystwyth", + +- expectedOutput: "%61%62%65%72%79%73%74%77%79%74%68", + +- recipeConfig: [ + +- { + +- "op": "To Hex", + +- "args": [ + +- "Percent", + + 0 + + ] + + } + +CHANGED: tests/operations/tests/Hexdump.mjs — +mkilijanek/tests/operations/tests/Hexdump.mjs +++ +gchq/tests/operations/tests/Hexdump.mjs @@ -153,6 +153,17 @@ ], + + }, + + { + +- name: "From Hexdump: xxd format, odd number of bytes", + +- input: "00000000: 6162 6364 65 abcde", + +- expectedOutput: "abcde", + +- recipeConfig: [ + +- { + +- op: "From Hexdump", + +- args: [] + +- } + +- ], + +- }, + +- { + + name: "From Hexdump: Wireshark", + + input: `00000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ........ ........ + +00000010 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f …….. …….. + +CHANGED: tests/operations/tests/JA4.mjs — +mkilijanek/tests/operations/tests/JA4.mjs +++ +gchq/tests/operations/tests/JA4.mjs @@ -27,6 +27,28 @@ { + + "op": "JA4 Fingerprint", + + "args": ["Hex", "JA4 Original Rendering"] + +- } + +- ], + +- }, + +- { + +- name: "JA4 Fingerprint: TLS 1.3 with whitespace-only ALPN", + +- input: "1603010200010001fc0303ed338a18e711d670cdc472ff570a5b59f1ace12e5365918bf68bf845019147b6207e4437bfb062d98a4aeb753be8f09022a9dc9413d7694dad4db57fcdcf076e820024130213031301c02cc030c02bc02fcca9cca8c024c028c023c027009f009e006b006700ff0100018f0000001800160000136465762e636f6e74656e74677261622e6e6574000b000403000102000a00160014001d0017001e00190018010001010102010301040023000000100004000201200016000000170000000d002a0028040305030603080708080809080a080b080408050806040105010601030303010302040205020602002b00050403040303002d00020101003300260024001d00207af053336d5e2c1675aa4c6ce78de5e5fdbd296538113f051ea17ccb64289f22001500d2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + +- expectedOutput: "t13d181220_85036bcba153_d41ae481755e", + +- recipeConfig: [ + +- { + +- "op": "JA4 Fingerprint", + +- "args": ["Hex", "JA4"] + +- } + +- ], + +- }, + +- { + +- name: "JA4 Fingerprint: TLS 1.3 with ALPN containing a whitespace", + +- input: "1603010200010001fc0303273682a603be3f64dd025df4ad0f4d2d13043c3a233405a68bb29b865808749a20f4dfc40242b2fce38fae26c516ef9bef20a1b9349eba3c003780168d72471f5c0024130213031301c02cc030c02bc02fcca9cca8c024c028c023c027009f009e006b006700ff0100018f0000001800160000136465762e636f6e74656e74677261622e6e6574000b000403000102000a00160014001d0017001e0019001801000101010201030104002300000010000500030261200016000000170000000d002a0028040305030603080708080809080a080b080408050806040105010601030303010302040205020602002b00050403040303002d00020101003300260024001d0020f4dd1567bd858d3a9f1d88db1fee6a10ab0ea1aa6afe96ffb6a7c4d79dea4075001500d10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + +- expectedOutput: "t13d181260_85036bcba153_d41ae481755e", + +- recipeConfig: [ + +- { + +- "op": "JA4 Fingerprint", + +- "args": ["Hex", "JA4"] + + } + + ], + + }, diff --git a/Dockerfile b/Dockerfile index b82497b1..ced81d78 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,10 +27,9 @@ RUN npm run build ######################################### # Package static build files into nginx # ######################################### -# We are using Github Actions: redhat-actions/buildah-build@v2 which needs manual selection of arch in base image -# Remove TARGETARCH if docker buildx is supported in the CI release as --platform=$TARGETPLATFORM will be automatically set -ARG TARGETPLATFORM -FROM --platform=${TARGETPLATFORM} nginx:1.27-alpine AS cyberchef +FROM nginx:stable-alpine AS cyberchef + +LABEL maintainer="GCHQ " COPY --from=builder --chown=nginx:nginx /app/build/prod /usr/share/nginx/html/ diff --git a/Gruntfile.js b/Gruntfile.js index d3f6b635..a67aa5b8 100755 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -432,18 +432,6 @@ module.exports = function (grunt) { }, stdout: false }, - fixJimpModule: { - command: function () { - switch (process.platform) { - case "darwin": - // Space added before comma to prevent multiple modifications - return `sed -i '' 's/"es\\/index.js",/"es\\/index.js" ,\\n "type": "module",/' ./node_modules/jimp/package.json`; - default: - return `sed -i 's/"es\\/index.js",/"es\\/index.js" ,\\n "type": "module",/' ./node_modules/jimp/package.json`; - } - }, - stdout: false - } }, }); }; diff --git a/package.json b/package.json index 66320acc..efdebcfa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cyberchef", - "version": "10.19.4", + "version": "10.22.1", "description": "The Cyber Swiss Army Knife for encryption, encoding, compression and data analysis.", "author": "n1474335 ", "homepage": "https://gchq.github.io/CyberChef", @@ -118,7 +118,7 @@ "chi-squared": "^1.1.0", "codepage": "^1.15.0", "crypto-api": "^0.8.5", - "crypto-browserify": "^3.12.0", + "crypto-browserify": "^3.12.1", "crypto-js": "^4.2.0", "ctph.js": "0.0.5", "d3": "7.9.0", @@ -137,7 +137,7 @@ "hash-wasm": "^4.12.0", "highlight.js": "^11.9.0", "ieee754": "^1.2.1", - "jimp": "^0.22.12", + "jimp": "^1.6.0", "jq-web": "^0.5.1", "jquery": "3.7.1", "js-sha3": "^0.9.3", @@ -148,7 +148,7 @@ "jsonwebtoken": "9.0.0", "jsqr": "^1.4.0", "jsrsasign": "^11.1.0", - "kbpgp": "2.1.15", + "kbpgp": "^2.1.17", "libbzip2-wasm": "0.0.4", "libyara-wasm": "^1.2.1", "lodash": "^4.17.21", @@ -198,16 +198,17 @@ "start": "npx grunt dev", "build": "npx grunt prod", "node": "npx grunt node", - "repl": "node --experimental-modules --experimental-json-modules --experimental-specifier-resolution=node --no-experimental-fetch --no-warnings src/node/repl.mjs", - "test": "npx grunt configTests && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch tests/node/index.mjs && node --experimental-modules --experimental-json-modules --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch --trace-uncaught tests/operations/index.mjs", + "repl": "node --no-experimental-fetch --no-warnings src/node/repl.mjs", + "test": "npx grunt configTests && node --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch tests/node/index.mjs && node --no-warnings --no-deprecation --openssl-legacy-provider --no-experimental-fetch --trace-uncaught tests/operations/index.mjs", "testnodeconsumer": "npx grunt testnodeconsumer", "testui": "npx grunt testui", "testuidev": "npx nightwatch --env=dev", "lint": "npx grunt lint", "lint:grammar": "cspell ./src", "postinstall": "npx grunt exec:fixCryptoApiImports && npx grunt exec:fixSnackbarMarkup && npx grunt exec:fixJimpModule", - "newop": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newOperation.mjs", - "minor": "node --experimental-modules --experimental-json-modules src/core/config/scripts/newMinorVersion.mjs", + "newop": "node src/core/config/scripts/newOperation.mjs", + "minor": "node src/core/config/scripts/newMinorVersion.mjs", + "tag": "git tag -s \"v$(npm pkg get version | xargs)\" -m \"$(npm pkg get version | xargs)\" && echo \"Created v$(npm pkg get version | xargs), now check and push the tag\"", "getheapsize": "node -e 'console.log(`node heap limit = ${require(\"v8\").getHeapStatistics().heap_size_limit / (1024 * 1024)} Mb`)'", "setheapsize": "export NODE_OPTIONS=--max_old_space_size=2048", "security:audit": "npm audit", @@ -216,5 +217,12 @@ "security:triage": "node scripts/vulnerability-triage.js", "security:triage:json": "node scripts/vulnerability-triage.js --json", "security:check": "npm run security:triage && npm run lint" + }, + "overrides": { + "pbkdf2": "^3.1.5", + "sha.js": "^2.4.12" + }, + "engines": { + "node": ">=24" } } diff --git a/src/core/ChefWorker.js b/src/core/ChefWorker.js index a43993f9..43f595f3 100644 --- a/src/core/ChefWorker.js +++ b/src/core/ChefWorker.js @@ -7,7 +7,7 @@ */ import Chef from "./Chef.mjs"; -import OperationConfig from "./config/OperationConfig.json" assert {type: "json"}; +import OperationConfig from "./config/OperationConfig.json" with { type: "json" }; import OpModules from "./config/modules/OpModules.mjs"; import loglevelMessagePrefix from "loglevel-message-prefix"; diff --git a/src/core/Recipe.mjs b/src/core/Recipe.mjs index 3ce40aa4..46991190 100755 --- a/src/core/Recipe.mjs +++ b/src/core/Recipe.mjs @@ -4,7 +4,7 @@ * @license Apache-2.0 */ -import OperationConfig from "./config/OperationConfig.json" assert {type: "json"}; +import OperationConfig from "./config/OperationConfig.json" with { type: "json" }; import OperationError from "./errors/OperationError.mjs"; import Operation from "./Operation.mjs"; import DishError from "./errors/DishError.mjs"; @@ -229,6 +229,7 @@ class Recipe { } this.lastRunOp = op; } catch (err) { + log.error(err); // Return expected errors as output if (err instanceof OperationError || err?.type === "OperationError") { // Cannot rely on `err instanceof OperationError` here as extending diff --git a/src/core/Utils.mjs b/src/core/Utils.mjs index a9c381d7..eae86374 100755 --- a/src/core/Utils.mjs +++ b/src/core/Utils.mjs @@ -177,7 +177,7 @@ class Utils { */ static printable(str, preserveWs=false, onlyAscii=false) { if (onlyAscii) { - return str.replace(/[^\x20-\x7f]/g, "."); + return str.replace(/[^\x20-\x7e]/g, "."); } // eslint-disable-next-line no-misleading-character-class diff --git a/src/core/config/Categories.json b/src/core/config/Categories.json index 434c8bb6..aac00ca1 100644 --- a/src/core/config/Categories.json +++ b/src/core/config/Categories.json @@ -26,6 +26,8 @@ "From Base45", "To Base58", "From Base58", + "To Bech32", + "From Bech32", "To Base62", "From Base62", "To Base64", diff --git a/src/core/config/scripts/generateConfig.mjs b/src/core/config/scripts/generateConfig.mjs index 64c7cb81..5deac2d8 100644 --- a/src/core/config/scripts/generateConfig.mjs +++ b/src/core/config/scripts/generateConfig.mjs @@ -20,7 +20,7 @@ const dir = path.join(process.cwd() + "/src/core/config/"); if (!fs.existsSync(dir)) { console.log("\nCWD: " + process.cwd()); console.log("Error: generateConfig.mjs should be run from the project root"); - console.log("Example> node --experimental-modules src/core/config/scripts/generateConfig.mjs"); + console.log("Example> node src/core/config/scripts/generateConfig.mjs"); process.exit(1); } diff --git a/src/core/config/scripts/generateOpsIndex.mjs b/src/core/config/scripts/generateOpsIndex.mjs index d8dd6a70..d58fe32a 100644 --- a/src/core/config/scripts/generateOpsIndex.mjs +++ b/src/core/config/scripts/generateOpsIndex.mjs @@ -17,7 +17,7 @@ const dir = path.join(process.cwd() + "/src/core/config/"); if (!fs.existsSync(dir)) { console.log("\nCWD: " + process.cwd()); console.log("Error: generateOpsIndex.mjs should be run from the project root"); - console.log("Example> node --experimental-modules src/core/config/scripts/generateOpsIndex.mjs"); + console.log("Example> node src/core/config/scripts/generateOpsIndex.mjs"); process.exit(1); } diff --git a/src/core/config/scripts/newMinorVersion.mjs b/src/core/config/scripts/newMinorVersion.mjs index 67754890..d22ef43b 100644 --- a/src/core/config/scripts/newMinorVersion.mjs +++ b/src/core/config/scripts/newMinorVersion.mjs @@ -7,138 +7,197 @@ */ /* eslint no-console: ["off"] */ +/* eslint jsdoc/require-jsdoc: ["off"] */ -import prompt from "prompt"; -import colors from "colors"; import path from "path"; -import fs from "fs"; +import fs from "fs"; import process from "process"; +import { execSync } from "child_process"; -const dir = path.join(process.cwd() + "/src/core/config/"); -if (!fs.existsSync(dir)) { - console.log("\nCWD: " + process.cwd()); - console.log("Error: newMinorVersion.mjs should be run from the project root"); - console.log("Example> node --experimental-modules src/core/config/scripts/newMinorVersion.mjs"); - process.exit(1); -} +const ignoredAuthors = ["github-advanced-security[bot]", "dependabot[bot]"]; -let changelogData = fs.readFileSync(path.join(process.cwd(), "CHANGELOG.md"), "utf8"); -const lastVersion = changelogData.match(/## Details\s+### \[(\d+)\.(\d+)\.(\d+)\]/); -const newVersion = [ - parseInt(lastVersion[1], 10), - parseInt(lastVersion[2], 10) + 1, - 0 -]; +async function main() { + const dir = path.join(process.cwd() + "/src/core/config/"); + if (!fs.existsSync(dir)) { + console.log("\nCWD: " + process.cwd()); + console.log( + "Error: newMinorVersion.mjs should be run from the project root", + ); + console.log( + "Example> node --experimental-modules src/core/config/scripts/newMinorVersion.mjs", + ); + process.exit(1); + } -let knownContributors = changelogData.match(/^\[@([^\]]+)\]/gm); -knownContributors = knownContributors.map(c => c.slice(2, -1)); + let changelogData = fs.readFileSync( + path.join(process.cwd(), "CHANGELOG.md"), + "utf8", + ); + const lastVersion = changelogData.match( + /## Details\s+### \[(\d+)\.(\d+)\.(\d+)\]/, + ); + const newVersion = [ + parseInt(lastVersion[1], 10), + parseInt(lastVersion[2], 10) + 1, + 0, + ]; -const date = (new Date()).toISOString().split("T")[0]; + let knownContributors = changelogData.match(/^\[@([^\]]+)\]/gm); + knownContributors = knownContributors.map((c) => c.slice(2, -1)); -const schema = { - properties: { - message: { - description: "A short but descriptive summary of a feature in this version", - example: "Added 'Op name' operation", - prompt: "Feature description", - type: "string", - required: true, + const date = new Date().toISOString().split("T")[0]; + + const lastVersionSha = execSync( + `git rev-list -n 1 v${lastVersion[1]}.${lastVersion[2]}.${lastVersion[3]}`, + { + encoding: "utf8", }, - author: { - description: "The author of the feature (only one supported, edit manually to add more)", - example: "n1474335", - prompt: "Author", - type: "string", - default: "n1474335" - }, - id: { - description: "The PR number or full commit hash for this feature.", - example: "1200", - prompt: "Pull request or commit ID", - type: "string" - }, - another: { - description: "y/n", - example: "y", - prompt: "Add another feature?", - type: "string", - pattern: /^[yn]$/, + ).trim(); + if (lastVersionSha.length !== 40) { + throw new Error( + `Unexpected output from git rev-list: ${lastVersionSha}`, + ); + } + + const features = []; + + const commits = await ( + await fetch(`https://api.github.com/repos/gchq/cyberchef/commits`) + ).json(); + let foundLast = false; + for (const commit of commits) { + if (commit.sha === lastVersionSha) { + foundLast = true; + break; + } else { + const feature = { + message: "", + authors: [], + id: "", + }; + + const msgparts = commit.commit.message.split("\n\n"); + feature.message = msgparts[0]; + const prIdMatch = feature.message.match(/\(#(\d+)\)$/); + if (prIdMatch !== null) { + feature.message = feature.message + .replace(prIdMatch[0], "") + .trim(); + feature.id = prIdMatch[1]; + } + + if (!ignoredAuthors.includes(commit.author.login)) { + feature.authors.push(commit.author.login); + } + + if (msgparts.length > 1) { + msgparts[1] + .split("\n") + .filter((line) => line.startsWith("Co-authored-by: ")) + .forEach((line) => { + let coAuthor = line.slice("Co-authored-by: ".length); + if (coAuthor.indexOf(">") !== -1) { + const email = coAuthor.slice( + coAuthor.indexOf("<") + 1, + coAuthor.indexOf(">"), + ); + if (email.endsWith("@users.noreply.github.com")) { + coAuthor = email.slice( + email.indexOf("+") + 1, + -"@users.noreply.github.com".length, + ); + } else { + throw new Error( + "Could not get ID of co-author: " + + coAuthor, + ); + } + } else { + throw new Error( + "Could not get email of co-author: " + coAuthor, + ); + } + if (!ignoredAuthors.includes(coAuthor)) { + feature.authors.push(coAuthor); + } + }); + } + + features.push(feature); } } -}; + if (!foundLast) { + throw new Error( + `Could not find last version commit: ${lastVersionSha} - need to add paging functionality`, + ); + } -// Build schema -for (const prop in schema.properties) { - const p = schema.properties[prop]; - p.description = "\n" + colors.white(p.description) + colors.cyan("\nExample: " + p.example) + "\n" + colors.green(p.prompt); -} + let message = `### [${newVersion[0]}.${newVersion[1]}.${newVersion[2]}] - ${date}\n`; -prompt.message = ""; -prompt.delimiter = ":".green; + const authors = []; + const prIDs = []; + const commitIDs = []; -const features = []; -const authors = []; -const prIDs = []; -const commitIDs = []; + features.forEach((feature) => { + const id = + feature.id.length > 10 ? feature.id.slice(0, 7) : "#" + feature.id; + message += `- ${feature.message} ${feature.authors.map((a) => `[@${a}]`).join(" ")} | [${id}]\n`; -prompt.start(); + feature.authors.forEach((author) => { + if (!knownContributors.includes(author)) { + knownContributors.push(author); + authors.push(`[@${author}]: https://github.com/${author}`); + } + }); -const getFeature = function() { - prompt.get(schema, (err, result) => { - if (err) { - console.log("\nExiting script."); - process.exit(0); - } - - features.push(result); - - if (result.another === "y") { - getFeature(); + if (feature.id.length > 10) { + commitIDs.push( + `[${id}]: https://github.com/gchq/CyberChef/commit/${feature.id}`, + ); } else { - let message = `### [${newVersion[0]}.${newVersion[1]}.${newVersion[2]}] - ${date}\n`; - - features.forEach(feature => { - const id = feature.id.length > 10 ? feature.id.slice(0, 7) : "#" + feature.id; - message += `- ${feature.message} [@${feature.author}] | [${id}]\n`; - - if (!knownContributors.includes(feature.author)) { - authors.push(`[@${feature.author}]: https://github.com/${feature.author}`); - } - - if (feature.id.length > 10) { - commitIDs.push(`[${id}]: https://github.com/gchq/CyberChef/commit/${feature.id}`); - } else { - prIDs.push(`[#${feature.id}]: https://github.com/gchq/CyberChef/pull/${feature.id}`); - } - }); - - // Message - changelogData = changelogData.replace(/## Details\n\n/, "## Details\n\n" + message + "\n"); - - // Tag - const newTag = `[${newVersion[0]}.${newVersion[1]}.${newVersion[2]}]: https://github.com/gchq/CyberChef/releases/tag/v${newVersion[0]}.${newVersion[1]}.${newVersion[2]}\n`; - changelogData = changelogData.replace(/\n\n(\[\d+\.\d+\.\d+\]: https)/, "\n\n" + newTag + "$1"); - - // Author - authors.forEach(author => { - changelogData = changelogData.replace(/(\n\[@[^\]]+\]: https:\/\/github\.com\/[^\n]+\n)\n/, "$1" + author + "\n\n"); - }); - - // Commit IDs - commitIDs.forEach(commitID => { - changelogData = changelogData.replace(/(\n\[[^\].]+\]: https:\/\/github.com\/gchq\/CyberChef\/commit\/[^\n]+\n)\n/, "$1" + commitID + "\n\n"); - }); - - // PR IDs - prIDs.forEach(prID => { - changelogData = changelogData.replace(/(\n\[#[^\]]+\]: https:\/\/github.com\/gchq\/CyberChef\/pull\/[^\n]+\n)\n*$/, "$1" + prID + "\n\n"); - }); - - fs.writeFileSync(path.join(process.cwd(), "CHANGELOG.md"), changelogData); - - console.log("Written CHANGELOG.md\nCommit changes and then run `npm version minor`."); + prIDs.push( + `[#${feature.id}]: https://github.com/gchq/CyberChef/pull/${feature.id}`, + ); } }); -}; -getFeature(); + // Message + changelogData = changelogData.replace( + /## Details\n\n/, + "## Details\n\n" + message + "\n", + ); + + // Tag + const newTag = `[${newVersion[0]}.${newVersion[1]}.${newVersion[2]}]: https://github.com/gchq/CyberChef/releases/tag/v${newVersion[0]}.${newVersion[1]}.${newVersion[2]}\n`; + changelogData = changelogData.replace( + /\n\n(\[\d+\.\d+\.\d+\]: https)/, + "\n\n" + newTag + "$1", + ); + + // Author + authors.forEach((author) => { + changelogData = changelogData.replace( + /(\n\[@[^\]]+\]: https:\/\/github\.com\/[^\n]+\n)\n/, + "$1" + author + "\n\n", + ); + }); + + // Commit IDs + commitIDs.forEach((commitID) => { + changelogData = changelogData.replace( + /(\n\[[^\].]+\]: https:\/\/github.com\/gchq\/CyberChef\/commit\/[^\n]+\n)\n/, + "$1" + commitID + "\n\n", + ); + }); + + // PR IDs + prIDs.forEach((prID) => { + changelogData = changelogData.replace( + /(\n\[#[^\]]+\]: https:\/\/github.com\/gchq\/CyberChef\/(?:pull|issues)\/[^\n]+\n)\n*$/, + "$1" + prID + "\n\n", + ); + }); + + fs.writeFileSync(path.join(process.cwd(), "CHANGELOG.md"), changelogData); +} +main().catch(console.error); diff --git a/src/core/config/scripts/newOperation.mjs b/src/core/config/scripts/newOperation.mjs index 1686f6eb..ffeb3df7 100644 --- a/src/core/config/scripts/newOperation.mjs +++ b/src/core/config/scripts/newOperation.mjs @@ -20,7 +20,7 @@ const dir = path.join(process.cwd() + "/src/core/operations/"); if (!fs.existsSync(dir)) { console.log("\nCWD: " + process.cwd()); console.log("Error: newOperation.mjs should be run from the project root"); - console.log("Example> node --experimental-modules src/core/config/scripts/newOperation.mjs"); + console.log("Example> node src/core/config/scripts/newOperation.mjs"); process.exit(1); } diff --git a/src/core/lib/Bech32.mjs b/src/core/lib/Bech32.mjs new file mode 100644 index 00000000..6b87a142 --- /dev/null +++ b/src/core/lib/Bech32.mjs @@ -0,0 +1,371 @@ +/** + * Pure JavaScript implementation of Bech32 and Bech32m encoding. + * + * Bech32 is defined in BIP-0173: https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki + * Bech32m is defined in BIP-0350: https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki + * + * @author Medjedtxm + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ + +import OperationError from "../errors/OperationError.mjs"; + +/** Bech32 character set (32 characters, excludes 1, b, i, o) */ +const CHARSET = "qpzry9x8gf2tvdw0s3jn54khce6mua7l"; + +/** Reverse lookup table for decoding */ +const CHARSET_REV = {}; +for (let i = 0; i < CHARSET.length; i++) { + CHARSET_REV[CHARSET[i]] = i; +} + +/** Checksum constant for Bech32 (BIP-0173) */ +const BECH32_CONST = 1; + +/** Checksum constant for Bech32m (BIP-0350) */ +const BECH32M_CONST = 0x2bc830a3; + +/** Generator polynomial coefficients for checksum */ +const GENERATOR = [0x3b6a57b2, 0x26508e6d, 0x1ea119fa, 0x3d4233dd, 0x2a1462b3]; + +/** + * Compute the polymod checksum + * @param {number[]} values - Array of 5-bit values + * @returns {number} - Checksum value + */ +function polymod(values) { + let chk = 1; + for (const v of values) { + const top = chk >> 25; + chk = ((chk & 0x1ffffff) << 5) ^ v; + for (let i = 0; i < 5; i++) { + if ((top >> i) & 1) { + chk ^= GENERATOR[i]; + } + } + } + return chk; +} + +/** + * Expand HRP for checksum computation + * @param {string} hrp - Human-readable part (lowercase) + * @returns {number[]} - Expanded values + */ +function hrpExpand(hrp) { + const result = []; + for (let i = 0; i < hrp.length; i++) { + result.push(hrp.charCodeAt(i) >> 5); + } + result.push(0); + for (let i = 0; i < hrp.length; i++) { + result.push(hrp.charCodeAt(i) & 31); + } + return result; +} + +/** + * Verify checksum of a Bech32/Bech32m string + * @param {string} hrp - Human-readable part (lowercase) + * @param {number[]} data - Data including checksum (5-bit values) + * @param {string} encoding - "Bech32" or "Bech32m" + * @returns {boolean} - True if checksum is valid + */ +function verifyChecksum(hrp, data, encoding) { + const constant = encoding === "Bech32m" ? BECH32M_CONST : BECH32_CONST; + return polymod(hrpExpand(hrp).concat(data)) === constant; +} + +/** + * Create checksum for Bech32/Bech32m encoding + * @param {string} hrp - Human-readable part (lowercase) + * @param {number[]} data - Data values (5-bit) + * @param {string} encoding - "Bech32" or "Bech32m" + * @returns {number[]} - 6 checksum values + */ +function createChecksum(hrp, data, encoding) { + const constant = encoding === "Bech32m" ? BECH32M_CONST : BECH32_CONST; + const values = hrpExpand(hrp).concat(data).concat([0, 0, 0, 0, 0, 0]); + const mod = polymod(values) ^ constant; + const result = []; + for (let i = 0; i < 6; i++) { + result.push((mod >> (5 * (5 - i))) & 31); + } + return result; +} + +/** + * Convert 8-bit bytes to 5-bit words + * @param {number[]|Uint8Array} data - Input bytes + * @returns {number[]} - 5-bit words + */ +export function toWords(data) { + let value = 0; + let bits = 0; + const result = []; + + for (let i = 0; i < data.length; i++) { + value = (value << 8) | data[i]; + bits += 8; + + while (bits >= 5) { + bits -= 5; + result.push((value >> bits) & 31); + } + } + + // Pad remaining bits + if (bits > 0) { + result.push((value << (5 - bits)) & 31); + } + + return result; +} + +/** + * Convert 5-bit words to 8-bit bytes + * @param {number[]} words - 5-bit words + * @returns {number[]} - Output bytes + */ +export function fromWords(words) { + let value = 0; + let bits = 0; + const result = []; + + for (let i = 0; i < words.length; i++) { + value = (value << 5) | words[i]; + bits += 5; + + while (bits >= 8) { + bits -= 8; + result.push((value >> bits) & 255); + } + } + + // Check for invalid padding per BIP-0173 + // Condition 1: Cannot have 5+ bits remaining (would indicate incomplete byte) + if (bits >= 5) { + throw new OperationError("Invalid padding: too many bits remaining"); + } + // Condition 2: Remaining padding bits must all be zero + if (bits > 0) { + const paddingValue = (value << (8 - bits)) & 255; + if (paddingValue !== 0) { + throw new OperationError("Invalid padding: non-zero bits in padding"); + } + } + + return result; +} + +/** + * Encode data to Bech32/Bech32m string + * + * @param {string} hrp - Human-readable part + * @param {number[]|Uint8Array} data - Data bytes to encode + * @param {string} encoding - "Bech32" or "Bech32m" + * @param {boolean} segwit - If true, treat first byte as witness version (for Bitcoin SegWit) + * @returns {string} - Encoded Bech32/Bech32m string + */ +export function encode(hrp, data, encoding = "Bech32", segwit = false) { + // Validate HRP + if (!hrp || hrp.length === 0) { + throw new OperationError("Human-Readable Part (HRP) cannot be empty."); + } + + // Check HRP characters (ASCII 33-126) + for (let i = 0; i < hrp.length; i++) { + const c = hrp.charCodeAt(i); + if (c < 33 || c > 126) { + throw new OperationError(`HRP contains invalid character at position ${i}. Only printable ASCII characters (33-126) are allowed.`); + } + } + + // Convert HRP to lowercase + const hrpLower = hrp.toLowerCase(); + + let words; + if (segwit && data.length >= 2) { + // SegWit encoding: first byte is witness version (0-16), rest is witness program + const witnessVersion = data[0]; + if (witnessVersion > 16) { + throw new OperationError(`Invalid witness version: ${witnessVersion}. Must be 0-16.`); + } + const witnessProgram = Array.prototype.slice.call(data, 1); + + // Validate witness program length per BIP-0141 + if (witnessProgram.length < 2 || witnessProgram.length > 40) { + throw new OperationError(`Invalid witness program length: ${witnessProgram.length}. Must be 2-40 bytes.`); + } + if (witnessVersion === 0 && witnessProgram.length !== 20 && witnessProgram.length !== 32) { + throw new OperationError(`Invalid witness program length for v0: ${witnessProgram.length}. Must be 20 or 32 bytes.`); + } + + // Witness version is kept as single 5-bit value, program is converted + words = [witnessVersion].concat(toWords(witnessProgram)); + } else { + // Generic encoding: convert all bytes to 5-bit words + words = toWords(data); + } + + // Create checksum + const checksum = createChecksum(hrpLower, words, encoding); + + // Build result string + let result = hrpLower + "1"; + for (const w of words.concat(checksum)) { + result += CHARSET[w]; + } + + // Check maximum length (90 characters) + if (result.length > 90) { + throw new OperationError(`Encoded string exceeds maximum length of 90 characters (got ${result.length}). Consider using smaller input data.`); + } + + return result; +} + +/** + * Decode a Bech32/Bech32m string + * + * @param {string} str - Bech32/Bech32m encoded string + * @param {string} encoding - "Bech32", "Bech32m", or "Auto-detect" + * @returns {{hrp: string, data: number[]}} - Decoded HRP and data bytes + */ +export function decode(str, encoding = "Auto-detect") { + // Check for empty input + if (!str || str.length === 0) { + throw new OperationError("Input cannot be empty."); + } + + // Check maximum length + if (str.length > 90) { + throw new OperationError(`Invalid Bech32 string: exceeds maximum length of 90 characters (got ${str.length}).`); + } + + // Check for mixed case + const hasUpper = /[A-Z]/.test(str); + const hasLower = /[a-z]/.test(str); + if (hasUpper && hasLower) { + throw new OperationError("Invalid Bech32 string: mixed case is not allowed. Use all uppercase or all lowercase."); + } + + // Convert to lowercase for processing + str = str.toLowerCase(); + + // Find separator (last occurrence of '1') + const sepIndex = str.lastIndexOf("1"); + if (sepIndex === -1) { + throw new OperationError("Invalid Bech32 string: no separator '1' found."); + } + + if (sepIndex === 0) { + throw new OperationError("Invalid Bech32 string: Human-Readable Part (HRP) cannot be empty."); + } + + if (sepIndex + 7 > str.length) { + throw new OperationError("Invalid Bech32 string: data part is too short (minimum 6 characters for checksum)."); + } + + // Extract HRP and data part + const hrp = str.substring(0, sepIndex); + const dataPart = str.substring(sepIndex + 1); + + // Validate HRP characters + for (let i = 0; i < hrp.length; i++) { + const c = hrp.charCodeAt(i); + if (c < 33 || c > 126) { + throw new OperationError(`HRP contains invalid character at position ${i}.`); + } + } + + // Decode data characters to 5-bit values + const data = []; + for (let i = 0; i < dataPart.length; i++) { + const c = dataPart[i]; + if (CHARSET_REV[c] === undefined) { + throw new OperationError(`Invalid character '${c}' at position ${sepIndex + 1 + i}.`); + } + data.push(CHARSET_REV[c]); + } + + // Verify checksum + let usedEncoding; + if (encoding === "Bech32") { + if (!verifyChecksum(hrp, data, "Bech32")) { + throw new OperationError("Invalid Bech32 checksum."); + } + usedEncoding = "Bech32"; + } else if (encoding === "Bech32m") { + if (!verifyChecksum(hrp, data, "Bech32m")) { + throw new OperationError("Invalid Bech32m checksum."); + } + usedEncoding = "Bech32m"; + } else { + // Auto-detect: try Bech32 first, then Bech32m + if (verifyChecksum(hrp, data, "Bech32")) { + usedEncoding = "Bech32"; + } else if (verifyChecksum(hrp, data, "Bech32m")) { + usedEncoding = "Bech32m"; + } else { + throw new OperationError("Invalid Bech32/Bech32m string: checksum verification failed."); + } + } + + // Remove checksum (last 6 values) + const words = data.slice(0, data.length - 6); + + // Check if this is likely a SegWit address (Bitcoin, Litecoin, etc.) + // For SegWit, the first 5-bit word is the witness version (0-16) + // and should be extracted separately, not bit-converted with the rest + const segwitHrps = ["bc", "tb", "ltc", "tltc", "bcrt"]; + const couldBeSegWit = segwitHrps.includes(hrp) && words.length > 0 && words[0] <= 16; + + let bytes; + let witnessVersion = null; + + if (couldBeSegWit) { + // Try SegWit decode first + try { + witnessVersion = words[0]; + const programWords = words.slice(1); + const programBytes = fromWords(programWords); + + // Validate SegWit witness program length (20 or 32 bytes for v0, 2-40 for others) + const validV0 = witnessVersion === 0 && (programBytes.length === 20 || programBytes.length === 32); + const validOther = witnessVersion !== 0 && programBytes.length >= 2 && programBytes.length <= 40; + + if (validV0 || validOther) { + // Valid SegWit address + bytes = [witnessVersion, ...programBytes]; + } else { + // Not valid SegWit, fall back to generic decode + witnessVersion = null; + bytes = fromWords(words); + } + } catch (e) { + // SegWit decode failed, try generic decode + witnessVersion = null; + try { + bytes = fromWords(words); + } catch (e2) { + throw new OperationError(`Failed to decode data: ${e2.message}`); + } + } + } else { + // Generic Bech32: convert all words + try { + bytes = fromWords(words); + } catch (e) { + throw new OperationError(`Failed to decode data: ${e.message}`); + } + } + + return { + hrp: hrp, + data: bytes, + encoding: usedEncoding, + witnessVersion: witnessVersion + }; +} diff --git a/src/core/lib/Hex.mjs b/src/core/lib/Hex.mjs index 78e1ad58..6f998e2b 100644 --- a/src/core/lib/Hex.mjs +++ b/src/core/lib/Hex.mjs @@ -33,7 +33,7 @@ export function toHex(data, delim=" ", padding=2, extraDelim="", lineSize=0) { if (data instanceof ArrayBuffer) data = new Uint8Array(data); let output = ""; - const prepend = (delim === "0x" || delim === "\\x"); + const prepend = (delim === "0x" || delim === "\\x" || delim === "%"); for (let i = 0; i < data.length; i++) { const hex = data[i].toString(16).padStart(padding, "0"); diff --git a/src/core/lib/ImageManipulation.mjs b/src/core/lib/ImageManipulation.mjs deleted file mode 100644 index 63a80fe4..00000000 --- a/src/core/lib/ImageManipulation.mjs +++ /dev/null @@ -1,251 +0,0 @@ -/** - * Image manipulation resources - * - * @author j433866 [j433866@gmail.com] - * @copyright Crown Copyright 2019 - * @license Apache-2.0 - */ - -import OperationError from "../errors/OperationError.mjs"; - -/** - * Gaussian blurs an image. - * - * @param {jimp} input - * @param {number} radius - * @param {boolean} fast - * @returns {jimp} - */ -export function gaussianBlur (input, radius) { - try { - // From http://blog.ivank.net/fastest-gaussian-blur.html - const boxes = boxesForGauss(radius, 3); - for (let i = 0; i < 3; i++) { - input = boxBlur(input, (boxes[i] - 1) / 2); - } - } catch (err) { - throw new OperationError(`Error blurring image. (${err})`); - } - - return input; -} - -/** - * - * @param {number} radius - * @param {number} numBoxes - * @returns {Array} - */ -function boxesForGauss(radius, numBoxes) { - const idealWidth = Math.sqrt((12 * radius * radius / numBoxes) + 1); - - let wl = Math.floor(idealWidth); - - if (wl % 2 === 0) { - wl--; - } - - const wu = wl + 2; - - const mIdeal = (12 * radius * radius - numBoxes * wl * wl - 4 * numBoxes * wl - 3 * numBoxes) / (-4 * wl - 4); - const m = Math.round(mIdeal); - - const sizes = []; - for (let i = 0; i < numBoxes; i++) { - sizes.push(i < m ? wl : wu); - } - return sizes; -} - -/** - * Applies a box blur effect to the image - * - * @param {jimp} source - * @param {number} radius - * @returns {jimp} - */ -function boxBlur (source, radius) { - const width = source.bitmap.width; - const height = source.bitmap.height; - let output = source.clone(); - output = boxBlurH(source, output, width, height, radius); - source = boxBlurV(output, source, width, height, radius); - - return source; -} - -/** - * Applies the horizontal blur - * - * @param {jimp} source - * @param {jimp} output - * @param {number} width - * @param {number} height - * @param {number} radius - * @returns {jimp} - */ -function boxBlurH (source, output, width, height, radius) { - const iarr = 1 / (radius + radius + 1); - for (let i = 0; i < height; i++) { - let ti = 0, - li = ti, - ri = ti + radius; - const idx = source.getPixelIndex(ti, i); - const firstValRed = source.bitmap.data[idx], - firstValGreen = source.bitmap.data[idx + 1], - firstValBlue = source.bitmap.data[idx + 2], - firstValAlpha = source.bitmap.data[idx + 3]; - - const lastIdx = source.getPixelIndex(width - 1, i), - lastValRed = source.bitmap.data[lastIdx], - lastValGreen = source.bitmap.data[lastIdx + 1], - lastValBlue = source.bitmap.data[lastIdx + 2], - lastValAlpha = source.bitmap.data[lastIdx + 3]; - - let red = (radius + 1) * firstValRed; - let green = (radius + 1) * firstValGreen; - let blue = (radius + 1) * firstValBlue; - let alpha = (radius + 1) * firstValAlpha; - - for (let j = 0; j < radius; j++) { - const jIdx = source.getPixelIndex(ti + j, i); - red += source.bitmap.data[jIdx]; - green += source.bitmap.data[jIdx + 1]; - blue += source.bitmap.data[jIdx + 2]; - alpha += source.bitmap.data[jIdx + 3]; - } - - for (let j = 0; j <= radius; j++) { - const jIdx = source.getPixelIndex(ri++, i); - red += source.bitmap.data[jIdx] - firstValRed; - green += source.bitmap.data[jIdx + 1] - firstValGreen; - blue += source.bitmap.data[jIdx + 2] - firstValBlue; - alpha += source.bitmap.data[jIdx + 3] - firstValAlpha; - - const tiIdx = source.getPixelIndex(ti++, i); - output.bitmap.data[tiIdx] = Math.round(red * iarr); - output.bitmap.data[tiIdx + 1] = Math.round(green * iarr); - output.bitmap.data[tiIdx + 2] = Math.round(blue * iarr); - output.bitmap.data[tiIdx + 3] = Math.round(alpha * iarr); - } - - for (let j = radius + 1; j < width - radius; j++) { - const riIdx = source.getPixelIndex(ri++, i); - const liIdx = source.getPixelIndex(li++, i); - red += source.bitmap.data[riIdx] - source.bitmap.data[liIdx]; - green += source.bitmap.data[riIdx + 1] - source.bitmap.data[liIdx + 1]; - blue += source.bitmap.data[riIdx + 2] - source.bitmap.data[liIdx + 2]; - alpha += source.bitmap.data[riIdx + 3] - source.bitmap.data[liIdx + 3]; - - const tiIdx = source.getPixelIndex(ti++, i); - output.bitmap.data[tiIdx] = Math.round(red * iarr); - output.bitmap.data[tiIdx + 1] = Math.round(green * iarr); - output.bitmap.data[tiIdx + 2] = Math.round(blue * iarr); - output.bitmap.data[tiIdx + 3] = Math.round(alpha * iarr); - } - - for (let j = width - radius; j < width; j++) { - const liIdx = source.getPixelIndex(li++, i); - red += lastValRed - source.bitmap.data[liIdx]; - green += lastValGreen - source.bitmap.data[liIdx + 1]; - blue += lastValBlue - source.bitmap.data[liIdx + 2]; - alpha += lastValAlpha - source.bitmap.data[liIdx + 3]; - - const tiIdx = source.getPixelIndex(ti++, i); - output.bitmap.data[tiIdx] = Math.round(red * iarr); - output.bitmap.data[tiIdx + 1] = Math.round(green * iarr); - output.bitmap.data[tiIdx + 2] = Math.round(blue * iarr); - output.bitmap.data[tiIdx + 3] = Math.round(alpha * iarr); - } - } - return output; -} - -/** - * Applies the vertical blur - * - * @param {jimp} source - * @param {jimp} output - * @param {number} width - * @param {number} height - * @param {number} radius - * @returns {jimp} - */ -function boxBlurV (source, output, width, height, radius) { - const iarr = 1 / (radius + radius + 1); - for (let i = 0; i < width; i++) { - let ti = 0, - li = ti, - ri = ti + radius; - - const idx = source.getPixelIndex(i, ti); - - const firstValRed = source.bitmap.data[idx], - firstValGreen = source.bitmap.data[idx + 1], - firstValBlue = source.bitmap.data[idx + 2], - firstValAlpha = source.bitmap.data[idx + 3]; - - const lastIdx = source.getPixelIndex(i, height - 1), - lastValRed = source.bitmap.data[lastIdx], - lastValGreen = source.bitmap.data[lastIdx + 1], - lastValBlue = source.bitmap.data[lastIdx + 2], - lastValAlpha = source.bitmap.data[lastIdx + 3]; - - let red = (radius + 1) * firstValRed; - let green = (radius + 1) * firstValGreen; - let blue = (radius + 1) * firstValBlue; - let alpha = (radius + 1) * firstValAlpha; - - for (let j = 0; j < radius; j++) { - const jIdx = source.getPixelIndex(i, ti + j); - red += source.bitmap.data[jIdx]; - green += source.bitmap.data[jIdx + 1]; - blue += source.bitmap.data[jIdx + 2]; - alpha += source.bitmap.data[jIdx + 3]; - } - - for (let j = 0; j <= radius; j++) { - const riIdx = source.getPixelIndex(i, ri++); - red += source.bitmap.data[riIdx] - firstValRed; - green += source.bitmap.data[riIdx + 1] - firstValGreen; - blue += source.bitmap.data[riIdx + 2] - firstValBlue; - alpha += source.bitmap.data[riIdx + 3] - firstValAlpha; - - const tiIdx = source.getPixelIndex(i, ti++); - output.bitmap.data[tiIdx] = Math.round(red * iarr); - output.bitmap.data[tiIdx + 1] = Math.round(green * iarr); - output.bitmap.data[tiIdx + 2] = Math.round(blue * iarr); - output.bitmap.data[tiIdx + 3] = Math.round(alpha * iarr); - } - - for (let j = radius + 1; j < height - radius; j++) { - const riIdx = source.getPixelIndex(i, ri++); - const liIdx = source.getPixelIndex(i, li++); - red += source.bitmap.data[riIdx] - source.bitmap.data[liIdx]; - green += source.bitmap.data[riIdx + 1] - source.bitmap.data[liIdx + 1]; - blue += source.bitmap.data[riIdx + 2] - source.bitmap.data[liIdx + 2]; - alpha += source.bitmap.data[riIdx + 3] - source.bitmap.data[liIdx + 3]; - - const tiIdx = source.getPixelIndex(i, ti++); - output.bitmap.data[tiIdx] = Math.round(red * iarr); - output.bitmap.data[tiIdx + 1] = Math.round(green * iarr); - output.bitmap.data[tiIdx + 2] = Math.round(blue * iarr); - output.bitmap.data[tiIdx + 3] = Math.round(alpha * iarr); - } - - for (let j = height - radius; j < height; j++) { - const liIdx = source.getPixelIndex(i, li++); - red += lastValRed - source.bitmap.data[liIdx]; - green += lastValGreen - source.bitmap.data[liIdx + 1]; - blue += lastValBlue - source.bitmap.data[liIdx + 2]; - alpha += lastValAlpha - source.bitmap.data[liIdx + 3]; - - const tiIdx = source.getPixelIndex(i, ti++); - output.bitmap.data[tiIdx] = Math.round(red * iarr); - output.bitmap.data[tiIdx + 1] = Math.round(green * iarr); - output.bitmap.data[tiIdx + 2] = Math.round(blue * iarr); - output.bitmap.data[tiIdx + 3] = Math.round(alpha * iarr); - } - } - return output; -} diff --git a/src/core/lib/JA4.mjs b/src/core/lib/JA4.mjs index f600f4d8..58422bca 100644 --- a/src/core/lib/JA4.mjs +++ b/src/core/lib/JA4.mjs @@ -91,9 +91,7 @@ export function toJA4(bytes) { let alpn = "00"; for (const ext of tlsr.handshake.value.extensions.value) { if (ext.type.value === "application_layer_protocol_negotiation") { - alpn = parseFirstALPNValue(ext.value.data); - alpn = alpn.charAt(0) + alpn.charAt(alpn.length - 1); - if (alpn.charCodeAt(0) > 127) alpn = "99"; + alpn = alpnFingerprint(parseFirstALPNValue(ext.value.data)); break; } } @@ -212,9 +210,7 @@ export function toJA4S(bytes) { let alpn = "00"; for (const ext of tlsr.handshake.value.extensions.value) { if (ext.type.value === "application_layer_protocol_negotiation") { - alpn = parseFirstALPNValue(ext.value.data); - alpn = alpn.charAt(0) + alpn.charAt(alpn.length - 1); - if (alpn.charCodeAt(0) > 127) alpn = "99"; + alpn = alpnFingerprint(parseFirstALPNValue(ext.value.data)); break; } } @@ -262,3 +258,33 @@ function tlsVersionMapper(version) { default: return "00"; // Unknown } } + +/** + * Checks if a byte is ASCII alphanumeric (0-9, A-Z, a-z). + * @param {number} byte + * @returns {boolean} + */ +function isAlphanumeric(byte) { + return (byte >= 0x30 && byte <= 0x39) || + (byte >= 0x41 && byte <= 0x5A) || + (byte >= 0x61 && byte <= 0x7A); +} + +/** + * Computes the 2-character ALPN fingerprint from raw ALPN bytes. + * If both first and last bytes are ASCII alphanumeric, returns their characters. + * Otherwise, returns first hex digit of first byte + last hex digit of last byte. + * @param {Uint8Array|null} rawBytes + * @returns {string} + */ +function alpnFingerprint(rawBytes) { + if (!rawBytes || rawBytes.length === 0) return "00"; + const firstByte = rawBytes[0]; + const lastByte = rawBytes[rawBytes.length - 1]; + if (isAlphanumeric(firstByte) && isAlphanumeric(lastByte)) { + return String.fromCharCode(firstByte) + String.fromCharCode(lastByte); + } + const firstHex = firstByte.toString(16).padStart(2, "0"); + const lastHex = lastByte.toString(16).padStart(2, "0"); + return firstHex[0] + lastHex[1]; +} diff --git a/src/core/lib/Magic.mjs b/src/core/lib/Magic.mjs index 14111ec7..ad407de6 100644 --- a/src/core/lib/Magic.mjs +++ b/src/core/lib/Magic.mjs @@ -1,4 +1,4 @@ -import OperationConfig from "../config/OperationConfig.json" assert {type: "json"}; +import OperationConfig from "../config/OperationConfig.json" with { type: "json" }; import Utils, { isWorkerEnvironment } from "../Utils.mjs"; import Recipe from "../Recipe.mjs"; import Dish from "../Dish.mjs"; diff --git a/src/core/lib/QRCode.mjs b/src/core/lib/QRCode.mjs index ccac4f29..43f9ec9a 100644 --- a/src/core/lib/QRCode.mjs +++ b/src/core/lib/QRCode.mjs @@ -10,7 +10,7 @@ import OperationError from "../errors/OperationError.mjs"; import jsQR from "jsqr"; import qr from "qr-image"; import Utils from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Parses a QR code image from an image @@ -29,18 +29,31 @@ export async function parseQrCode(input, normalise) { try { if (normalise) { - image.rgba(false); - image.background(0xFFFFFFFF); - image.normalize(); image.greyscale(); - image = await image.getBufferAsync(Jimp.MIME_JPEG); - image = await Jimp.read(image); + image.normalize(); } } catch (err) { throw new OperationError(`Error normalising image. (${err})`); } - const qrData = jsQR(image.bitmap.data, image.getWidth(), image.getHeight()); + // Remove transparency which jsQR cannot handle + image.scan((x, y, idx) => { + // If pixel is fully transparent, make it opaque white + if (image.bitmap.data[idx + 3] === 0x00) { + image.bitmap.data[idx + 0] = 0xff; + image.bitmap.data[idx + 1] = 0xff; + image.bitmap.data[idx + 2] = 0xff; + } + // Otherwise, make it fully opaque at its existing colour + image.bitmap.data[idx + 3] = 0xff; + }); + image = await Jimp.read(await image.getBuffer(JimpMime.jpeg)); + + const qrData = jsQR( + new Uint8ClampedArray(image.bitmap.data), + image.width, + image.height, + ); if (qrData) { return qrData.data; } else { @@ -58,7 +71,13 @@ export async function parseQrCode(input, normalise) { * @param {string} errorCorrection * @returns {ArrayBuffer} */ -export function generateQrCode(input, format, moduleSize, margin, errorCorrection) { +export function generateQrCode( + input, + format, + moduleSize, + margin, + errorCorrection, +) { const formats = ["SVG", "EPS", "PDF", "PNG"]; if (!formats.includes(format.toUpperCase())) { throw new OperationError("Unsupported QR code format."); @@ -70,7 +89,8 @@ export function generateQrCode(input, format, moduleSize, margin, errorCorrectio type: format, size: moduleSize, margin: margin, - "ec_level": errorCorrection.charAt(0).toUpperCase() + // eslint-disable-next-line camelcase + ec_level: errorCorrection.charAt(0).toUpperCase(), }); } catch (err) { throw new OperationError(`Error generating QR code. (${err})`); @@ -86,7 +106,7 @@ export function generateQrCode(input, format, moduleSize, margin, errorCorrectio case "PDF": return Utils.strToArrayBuffer(qrImage); case "PNG": - return qrImage.buffer; + return qrImage.buffer.slice(qrImage.byteOffset, qrImage.byteLength + qrImage.byteOffset); default: throw new OperationError("Unsupported QR code format."); } diff --git a/src/core/lib/TLS.mjs b/src/core/lib/TLS.mjs index dda3d4c2..a1d55e56 100644 --- a/src/core/lib/TLS.mjs +++ b/src/core/lib/TLS.mjs @@ -872,15 +872,15 @@ export function parseHighestSupportedVersion(bytes) { } /** - * Parses the application_layer_protocol_negotiation extension and returns the first value. + * Parses the application_layer_protocol_negotiation extension and returns the first value as raw bytes. * @param {Uint8Array} bytes - * @returns {number} + * @returns {Uint8Array|null} */ export function parseFirstALPNValue(bytes) { const s = new Stream(bytes); const alpnExtLen = s.readInt(2); - if (alpnExtLen < 3) return "00"; + if (alpnExtLen < 2) return null; const strLen = s.readInt(1); - if (strLen < 2) return "00"; - return s.readString(strLen); + if (strLen < 1) return null; + return s.getBytes(strLen); } diff --git a/src/core/operations/AddTextToImage.mjs b/src/core/operations/AddTextToImage.mjs index 2eb03e86..c137b492 100644 --- a/src/core/operations/AddTextToImage.mjs +++ b/src/core/operations/AddTextToImage.mjs @@ -9,13 +9,19 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { + Jimp, + JimpMime, + ResizeStrategy, + measureText, + measureTextHeight, + loadFont, +} from "jimp"; /** * Add Text To Image operation */ class AddTextToImage extends Operation { - /** * AddTextToImage constructor */ @@ -24,7 +30,8 @@ class AddTextToImage extends Operation { this.name = "Add Text To Image"; this.module = "Image"; - this.description = "Adds text onto an image.

Text can be horizontally or vertically aligned, or the position can be manually specified.
Variants of the Roboto font face are available in any size or colour."; + this.description = + "Adds text onto an image.

Text can be horizontally or vertically aligned, or the position can be manually specified.
Variants of the Roboto font face are available in any size or colour."; this.infoURL = ""; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; @@ -33,72 +40,67 @@ class AddTextToImage extends Operation { { name: "Text", type: "string", - value: "" + value: "", }, { name: "Horizontal align", type: "option", - value: ["None", "Left", "Center", "Right"] + value: ["None", "Left", "Center", "Right"], }, { name: "Vertical align", type: "option", - value: ["None", "Top", "Middle", "Bottom"] + value: ["None", "Top", "Middle", "Bottom"], }, { name: "X position", type: "number", - value: 0 + value: 0, }, { name: "Y position", type: "number", - value: 0 + value: 0, }, { name: "Size", type: "number", value: 32, - min: 8 + min: 8, }, { name: "Font face", type: "option", - value: [ - "Roboto", - "Roboto Black", - "Roboto Mono", - "Roboto Slab" - ] + value: ["Roboto", "Roboto Black", "Roboto Mono", "Roboto Slab"], }, { name: "Red", type: "number", value: 255, min: 0, - max: 255 + max: 255, }, { name: "Green", type: "number", value: 255, min: 0, - max: 255 + max: 255, }, { name: "Blue", type: "number", value: 255, min: 0, - max: 255 + max: 255, }, { name: "Alpha", type: "number", value: 255, min: 0, - max: 255 - } + max: 255, + }, ]; } @@ -131,41 +133,60 @@ class AddTextToImage extends Operation { } catch (err) { throw new OperationError(`Error loading image. (${err})`); } - try { - if (isWorkerEnvironment()) - self.sendStatusMessage("Adding text to image..."); - const fontsMap = {}; + if (isWorkerEnvironment()) + self.sendStatusMessage("Adding text to image..."); + + const fontsMap = {}; + try { const fonts = [ - import(/* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/Roboto72White.fnt"), - import(/* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoBlack72White.fnt"), - import(/* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoMono72White.fnt"), - import(/* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoSlab72White.fnt") + import( + /* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/Roboto72White.fnt" + ), + import( + /* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoBlack72White.fnt" + ), + import( + /* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoMono72White.fnt" + ), + import( + /* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoSlab72White.fnt" + ), ]; - await Promise.all(fonts) - .then(fonts => { - fontsMap.Roboto = fonts[0]; - fontsMap["Roboto Black"] = fonts[1]; - fontsMap["Roboto Mono"] = fonts[2]; - fontsMap["Roboto Slab"] = fonts[3]; - }); - - + await Promise.all(fonts).then((fonts) => { + fontsMap.Roboto = fonts[0]; + fontsMap["Roboto Black"] = fonts[1]; + fontsMap["Roboto Mono"] = fonts[2]; + fontsMap["Roboto Slab"] = fonts[3]; + }); // Make Webpack load the png font images await Promise.all([ - import(/* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/Roboto72White.png"), - import(/* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoSlab72White.png"), - import(/* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoMono72White.png"), - import(/* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoBlack72White.png") + import( + /* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/Roboto72White.png" + ), + import( + /* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoSlab72White.png" + ), + import( + /* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoMono72White.png" + ), + import( + /* webpackMode: "eager" */ "../../web/static/fonts/bmfonts/RobotoBlack72White.png" + ), ]); + } catch (err) { + throw new OperationError(`Error preparing fonts. (${err})`); + } + let jimpFont; + try { const font = fontsMap[fontFace]; // LoadFont needs an absolute url, so append the font name to self.docURL - const jimpFont = await Jimp.loadFont(self.docURL + "/" + font.default); + jimpFont = await loadFont(self.docURL + "/" + font.default); - jimpFont.pages.forEach(function(page) { + jimpFont.pages.forEach(function (page) { if (page.bitmap) { // Adjust the RGB values of the image pages to change the font colour. const pageWidth = page.bitmap.width; @@ -175,32 +196,56 @@ class AddTextToImage extends Operation { const idx = (iy * pageWidth + ix) << 2; const newRed = page.bitmap.data[idx] - (255 - red); - const newGreen = page.bitmap.data[idx + 1] - (255 - green); - const newBlue = page.bitmap.data[idx + 2] - (255 - blue); - const newAlpha = page.bitmap.data[idx + 3] - (255 - alpha); + const newGreen = + page.bitmap.data[idx + 1] - (255 - green); + const newBlue = + page.bitmap.data[idx + 2] - (255 - blue); + const newAlpha = + page.bitmap.data[idx + 3] - (255 - alpha); // Make sure the bitmap values don't go below 0 as that makes jimp very unhappy - page.bitmap.data[idx] = (newRed > 0) ? newRed : 0; - page.bitmap.data[idx + 1] = (newGreen > 0) ? newGreen : 0; - page.bitmap.data[idx + 2] = (newBlue > 0) ? newBlue : 0; - page.bitmap.data[idx + 3] = (newAlpha > 0) ? newAlpha : 0; + page.bitmap.data[idx] = newRed > 0 ? newRed : 0; + page.bitmap.data[idx + 1] = + newGreen > 0 ? newGreen : 0; + page.bitmap.data[idx + 2] = + newBlue > 0 ? newBlue : 0; + page.bitmap.data[idx + 3] = + newAlpha > 0 ? newAlpha : 0; } } } }); + } catch (err) { + throw new OperationError(`Error loading font. (${err})`); + } + try { // Create a temporary image to hold the rendered text - const textImage = new Jimp(Jimp.measureText(jimpFont, text), Jimp.measureTextHeight(jimpFont, text)); - textImage.print(jimpFont, 0, 0, text); + const textImage = new Jimp({ + width: measureText(jimpFont, text), + height: measureTextHeight(jimpFont, text), + }); + textImage.print({ + font: jimpFont, + x: 0, + y: 0, + text, + }); // Scale the rendered text image to the correct size const scaleFactor = size / 72; if (size !== 1) { // Use bicubic for decreasing size if (size > 1) { - textImage.scale(scaleFactor, Jimp.RESIZE_BICUBIC); + textImage.scale({ + f: scaleFactor, + mode: ResizeStrategy.BICUBIC, + }); } else { - textImage.scale(scaleFactor, Jimp.RESIZE_BILINEAR); + textImage.scale({ + f: scaleFactor, + mode: ResizeStrategy.BILINEAR, + }); } } @@ -210,10 +255,10 @@ class AddTextToImage extends Operation { xPos = 0; break; case "Center": - xPos = (image.getWidth() / 2) - (textImage.getWidth() / 2); + xPos = image.width / 2 - textImage.width / 2; break; case "Right": - xPos = image.getWidth() - textImage.getWidth(); + xPos = image.width - textImage.width; break; } @@ -222,25 +267,33 @@ class AddTextToImage extends Operation { yPos = 0; break; case "Middle": - yPos = (image.getHeight() / 2) - (textImage.getHeight() / 2); + yPos = image.height / 2 - textImage.height / 2; break; case "Bottom": - yPos = image.getHeight() - textImage.getHeight(); + yPos = image.height - textImage.height; break; } // Blit the rendered text image onto the original source image - image.blit(textImage, xPos, yPos); + image.blit({ + src: textImage, + x: xPos, + y: yPos, + }); + } catch (err) { + throw new OperationError(`Error adding text to image. (${err})`); + } + try { let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { - throw new OperationError(`Error adding text to image. (${err})`); + throw new OperationError(`Error exporting image. (${err})`); } } @@ -261,7 +314,6 @@ class AddTextToImage extends Operation { return ``; } - } export default AddTextToImage; diff --git a/src/core/operations/BlurImage.mjs b/src/core/operations/BlurImage.mjs index 17904180..ba46080f 100644 --- a/src/core/operations/BlurImage.mjs +++ b/src/core/operations/BlurImage.mjs @@ -9,14 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; -import { gaussianBlur } from "../lib/ImageManipulation.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Blur Image operation */ class BlurImage extends Operation { - /** * BlurImage constructor */ @@ -25,7 +23,8 @@ class BlurImage extends Operation { this.name = "Blur Image"; this.module = "Image"; - this.description = "Applies a blur effect to the image.

Gaussian blur is much slower than fast blur, but produces better results."; + this.description = + "Applies a blur effect to the image.

Gaussian blur is much slower than fast blur, but produces better results."; this.infoURL = "https://wikipedia.org/wiki/Gaussian_blur"; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; @@ -35,13 +34,13 @@ class BlurImage extends Operation { name: "Amount", type: "number", value: 5, - min: 1 + min: 1, }, { name: "Type", type: "option", - value: ["Fast", "Gaussian"] - } + value: ["Fast", "Gaussian"], + }, ]; } @@ -73,15 +72,15 @@ class BlurImage extends Operation { case "Gaussian": if (isWorkerEnvironment()) self.sendStatusMessage("Gaussian blurring image..."); - image = gaussianBlur(image, blurAmount); + image.gaussian(blurAmount); break; } let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { @@ -106,7 +105,6 @@ class BlurImage extends Operation { return ``; } - } export default BlurImage; diff --git a/src/core/operations/ContainImage.mjs b/src/core/operations/ContainImage.mjs index 853021e1..0304733b 100644 --- a/src/core/operations/ContainImage.mjs +++ b/src/core/operations/ContainImage.mjs @@ -9,13 +9,18 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { + Jimp, + JimpMime, + ResizeStrategy, + HorizontalAlign, + VerticalAlign, +} from "jimp"; /** * Contain Image operation */ class ContainImage extends Operation { - /** * ContainImage constructor */ @@ -24,7 +29,8 @@ class ContainImage extends Operation { this.name = "Contain Image"; this.module = "Image"; - this.description = "Scales an image to the specified width and height, maintaining the aspect ratio. The image may be letterboxed."; + this.description = + "Scales an image to the specified width and height, maintaining the aspect ratio. The image may be letterboxed."; this.infoURL = ""; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; @@ -34,33 +40,25 @@ class ContainImage extends Operation { name: "Width", type: "number", value: 100, - min: 1 + min: 1, }, { name: "Height", type: "number", value: 100, - min: 1 + min: 1, }, { name: "Horizontal align", type: "option", - value: [ - "Left", - "Center", - "Right" - ], - defaultIndex: 1 + value: ["Left", "Center", "Right"], + defaultIndex: 1, }, { name: "Vertical align", type: "option", - value: [ - "Top", - "Middle", - "Bottom" - ], - defaultIndex: 1 + value: ["Top", "Middle", "Bottom"], + defaultIndex: 1, }, { name: "Resizing algorithm", @@ -70,15 +68,15 @@ class ContainImage extends Operation { "Bilinear", "Bicubic", "Hermite", - "Bezier" + "Bezier", ], - defaultIndex: 1 + defaultIndex: 1, }, { name: "Opaque background", type: "boolean", - value: true - } + value: true, + }, ]; } @@ -91,20 +89,20 @@ class ContainImage extends Operation { const [width, height, hAlign, vAlign, alg, opaqueBg] = args; const resizeMap = { - "Nearest Neighbour": Jimp.RESIZE_NEAREST_NEIGHBOR, - "Bilinear": Jimp.RESIZE_BILINEAR, - "Bicubic": Jimp.RESIZE_BICUBIC, - "Hermite": Jimp.RESIZE_HERMITE, - "Bezier": Jimp.RESIZE_BEZIER + "Nearest Neighbour": ResizeStrategy.NEAREST_NEIGHBOR, + Bilinear: ResizeStrategy.BILINEAR, + Bicubic: ResizeStrategy.BICUBIC, + Hermite: ResizeStrategy.HERMITE, + Bezier: ResizeStrategy.BEZIER, }; const alignMap = { - "Left": Jimp.HORIZONTAL_ALIGN_LEFT, - "Center": Jimp.HORIZONTAL_ALIGN_CENTER, - "Right": Jimp.HORIZONTAL_ALIGN_RIGHT, - "Top": Jimp.VERTICAL_ALIGN_TOP, - "Middle": Jimp.VERTICAL_ALIGN_MIDDLE, - "Bottom": Jimp.VERTICAL_ALIGN_BOTTOM + Left: HorizontalAlign.LEFT, + Center: HorizontalAlign.CENTER, + Right: HorizontalAlign.RIGHT, + Top: VerticalAlign.TOP, + Middle: VerticalAlign.MIDDLE, + Bottom: VerticalAlign.BOTTOM, }; if (!isImage(input)) { @@ -117,22 +115,35 @@ class ContainImage extends Operation { } catch (err) { throw new OperationError(`Error loading image. (${err})`); } + const originalMime = image.mime; try { if (isWorkerEnvironment()) self.sendStatusMessage("Containing image..."); - image.contain(width, height, alignMap[hAlign] | alignMap[vAlign], resizeMap[alg]); + image.contain({ + w: width, + h: height, + align: alignMap[hAlign] | alignMap[vAlign], + mode: resizeMap[alg], + }); if (opaqueBg) { - const newImage = await Jimp.read(width, height, 0x000000FF); - newImage.blit(image, 0, 0); - image = newImage; + const newImage = new Jimp({ + width, + height, + color: 0x000000ff, + }); + image = newImage.blit({ + src: image, + x: 0, + y: 0, + }); } let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (originalMime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(originalMime); } return imageBuffer.buffer; } catch (err) { @@ -156,7 +167,6 @@ class ContainImage extends Operation { return ``; } - } export default ContainImage; diff --git a/src/core/operations/ConvertImageFormat.mjs b/src/core/operations/ConvertImageFormat.mjs index 7d57f33b..5a8cb6f4 100644 --- a/src/core/operations/ConvertImageFormat.mjs +++ b/src/core/operations/ConvertImageFormat.mjs @@ -8,13 +8,12 @@ import Operation from "../Operation.mjs"; import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime, PNGFilterType } from "jimp"; /** * Convert Image Format operation */ class ConvertImageFormat extends Operation { - /** * ConvertImageFormat constructor */ @@ -23,7 +22,8 @@ class ConvertImageFormat extends Operation { this.name = "Convert Image Format"; this.module = "Image"; - this.description = "Converts an image between different formats. Supported formats:

Note: GIF files are supported for input, but cannot be outputted."; + this.description = + "Converts an image between different formats. Supported formats:

Note: GIF files are supported for input, but cannot be outputted."; this.infoURL = "https://wikipedia.org/wiki/Image_file_formats"; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; @@ -32,39 +32,27 @@ class ConvertImageFormat extends Operation { { name: "Output Format", type: "option", - value: [ - "JPEG", - "PNG", - "BMP", - "TIFF" - ] + value: ["JPEG", "PNG", "BMP", "TIFF"], }, { name: "JPEG Quality", type: "number", value: 80, min: 1, - max: 100 + max: 100, }, { name: "PNG Filter Type", type: "option", - value: [ - "Auto", - "None", - "Sub", - "Up", - "Average", - "Paeth" - ] + value: ["Auto", "None", "Sub", "Up", "Average", "Paeth"], }, { name: "PNG Deflate Level", type: "number", value: 9, min: 0, - max: 9 - } + max: 9, + }, ]; } @@ -76,19 +64,19 @@ class ConvertImageFormat extends Operation { async run(input, args) { const [format, jpegQuality, pngFilterType, pngDeflateLevel] = args; const formatMap = { - "JPEG": Jimp.MIME_JPEG, - "PNG": Jimp.MIME_PNG, - "BMP": Jimp.MIME_BMP, - "TIFF": Jimp.MIME_TIFF + JPEG: JimpMime.jpeg, + PNG: JimpMime.png, + BMP: JimpMime.bmp, + TIFF: JimpMime.tiff, }; const pngFilterMap = { - "Auto": Jimp.PNG_FILTER_AUTO, - "None": Jimp.PNG_FILTER_NONE, - "Sub": Jimp.PNG_FILTER_SUB, - "Up": Jimp.PNG_FILTER_UP, - "Average": Jimp.PNG_FILTER_AVERAGE, - "Paeth": Jimp.PNG_FILTER_PATH + Auto: PNGFilterType.AUTO, + None: PNGFilterType.NONE, + Sub: PNGFilterType.SUB, + Up: PNGFilterType.UP, + Average: PNGFilterType.AVERAGE, + Paeth: PNGFilterType.PATH, }; const mime = formatMap[format]; @@ -103,18 +91,25 @@ class ConvertImageFormat extends Operation { throw new OperationError(`Error opening image file. (${err})`); } try { - switch (format) { - case "JPEG": - image.quality(jpegQuality); + let buffer; + switch (mime) { + case JimpMime.jpeg: + buffer = await image.getBuffer(mime, { + quality: jpegQuality, + }); break; - case "PNG": - image.filterType(pngFilterMap[pngFilterType]); - image.deflateLevel(pngDeflateLevel); + case JimpMime.png: + buffer = await image.getBuffer(mime, { + filterType: pngFilterMap[pngFilterType], + deflateLevel: pngDeflateLevel, + }); + break; + default: + buffer = await image.getBuffer(mime); break; } - const imageBuffer = await image.getBufferAsync(mime); - return imageBuffer.buffer; + return buffer.buffer; } catch (err) { throw new OperationError(`Error converting image format. (${err})`); } @@ -137,7 +132,6 @@ class ConvertImageFormat extends Operation { return ``; } - } export default ConvertImageFormat; diff --git a/src/core/operations/CoverImage.mjs b/src/core/operations/CoverImage.mjs index 7d4d07b9..bf9a9bd1 100644 --- a/src/core/operations/CoverImage.mjs +++ b/src/core/operations/CoverImage.mjs @@ -9,13 +9,18 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import jimp from "jimp/es/index.js"; +import { + Jimp, + JimpMime, + ResizeStrategy, + HorizontalAlign, + VerticalAlign, +} from "jimp"; /** * Cover Image operation */ class CoverImage extends Operation { - /** * CoverImage constructor */ @@ -24,7 +29,8 @@ class CoverImage extends Operation { this.name = "Cover Image"; this.module = "Image"; - this.description = "Scales the image to the given width and height, keeping the aspect ratio. The image may be clipped."; + this.description = + "Scales the image to the given width and height, keeping the aspect ratio. The image may be clipped."; this.infoURL = ""; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; @@ -34,33 +40,25 @@ class CoverImage extends Operation { name: "Width", type: "number", value: 100, - min: 1 + min: 1, }, { name: "Height", type: "number", value: 100, - min: 1 + min: 1, }, { name: "Horizontal align", type: "option", - value: [ - "Left", - "Center", - "Right" - ], - defaultIndex: 1 + value: ["Left", "Center", "Right"], + defaultIndex: 1, }, { name: "Vertical align", type: "option", - value: [ - "Top", - "Middle", - "Bottom" - ], - defaultIndex: 1 + value: ["Top", "Middle", "Bottom"], + defaultIndex: 1, }, { name: "Resizing algorithm", @@ -70,10 +68,10 @@ class CoverImage extends Operation { "Bilinear", "Bicubic", "Hermite", - "Bezier" + "Bezier", ], - defaultIndex: 1 - } + defaultIndex: 1, + }, ]; } @@ -86,20 +84,20 @@ class CoverImage extends Operation { const [width, height, hAlign, vAlign, alg] = args; const resizeMap = { - "Nearest Neighbour": jimp.RESIZE_NEAREST_NEIGHBOR, - "Bilinear": jimp.RESIZE_BILINEAR, - "Bicubic": jimp.RESIZE_BICUBIC, - "Hermite": jimp.RESIZE_HERMITE, - "Bezier": jimp.RESIZE_BEZIER + "Nearest Neighbour": ResizeStrategy.NEAREST_NEIGHBOR, + Bilinear: ResizeStrategy.BILINEAR, + Bicubic: ResizeStrategy.BICUBIC, + Hermite: ResizeStrategy.HERMITE, + Bezier: ResizeStrategy.BEZIER, }; const alignMap = { - "Left": jimp.HORIZONTAL_ALIGN_LEFT, - "Center": jimp.HORIZONTAL_ALIGN_CENTER, - "Right": jimp.HORIZONTAL_ALIGN_RIGHT, - "Top": jimp.VERTICAL_ALIGN_TOP, - "Middle": jimp.VERTICAL_ALIGN_MIDDLE, - "Bottom": jimp.VERTICAL_ALIGN_BOTTOM + Left: HorizontalAlign.LEFT, + Center: HorizontalAlign.CENTER, + Right: HorizontalAlign.RIGHT, + Top: VerticalAlign.TOP, + Middle: VerticalAlign.MIDDLE, + Bottom: VerticalAlign.BOTTOM, }; if (!isImage(input)) { @@ -108,19 +106,24 @@ class CoverImage extends Operation { let image; try { - image = await jimp.read(input); + image = await Jimp.read(input); } catch (err) { throw new OperationError(`Error loading image. (${err})`); } try { if (isWorkerEnvironment()) self.sendStatusMessage("Covering image..."); - image.cover(width, height, alignMap[hAlign] | alignMap[vAlign], resizeMap[alg]); + image.cover({ + w: width, + h: height, + align: alignMap[hAlign] | alignMap[vAlign], + mode: resizeMap[alg], + }); let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { @@ -144,7 +147,6 @@ class CoverImage extends Operation { return ``; } - } export default CoverImage; diff --git a/src/core/operations/CropImage.mjs b/src/core/operations/CropImage.mjs index 11a85e37..6b5047bc 100644 --- a/src/core/operations/CropImage.mjs +++ b/src/core/operations/CropImage.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Crop Image operation */ class CropImage extends Operation { - /** * CropImage constructor */ @@ -24,7 +23,8 @@ class CropImage extends Operation { this.name = "Crop Image"; this.module = "Image"; - this.description = "Crops an image to the specified region, or automatically crops edges.

Autocrop
Automatically crops same-colour borders from the image.

Autocrop tolerance
A percentage value for the tolerance of colour difference between pixels.

Only autocrop frames
Only crop real frames (all sides must have the same border)

Symmetric autocrop
Force autocrop to be symmetric (top/bottom and left/right are cropped by the same amount)

Autocrop keep border
The number of pixels of border to leave around the image."; + this.description = + "Crops an image to the specified region, or automatically crops edges.

Autocrop
Automatically crops same-colour borders from the image.

Autocrop tolerance
A percentage value for the tolerance of colour difference between pixels.

Only autocrop frames
Only crop real frames (all sides must have the same border)

Symmetric autocrop
Force autocrop to be symmetric (top/bottom and left/right are cropped by the same amount)

Autocrop keep border
The number of pixels of border to leave around the image."; this.infoURL = "https://wikipedia.org/wiki/Cropping_(image)"; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; @@ -34,30 +34,30 @@ class CropImage extends Operation { name: "X Position", type: "number", value: 0, - min: 0 + min: 0, }, { name: "Y Position", type: "number", value: 0, - min: 0 + min: 0, }, { name: "Width", type: "number", value: 10, - min: 1 + min: 1, }, { name: "Height", type: "number", value: 10, - min: 1 + min: 1, }, { name: "Autocrop", type: "boolean", - value: false + value: false, }, { name: "Autocrop tolerance (%)", @@ -65,24 +65,24 @@ class CropImage extends Operation { value: 0.02, min: 0, max: 100, - step: 0.01 + step: 0.01, }, { name: "Only autocrop frames", type: "boolean", - value: true + value: true, }, { name: "Symmetric autocrop", type: "boolean", - value: false + value: false, }, { name: "Autocrop keep border (px)", type: "number", value: 0, - min: 0 - } + min: 0, + }, ]; } @@ -92,7 +92,17 @@ class CropImage extends Operation { * @returns {byteArray} */ async run(input, args) { - const [xPos, yPos, width, height, autocrop, autoTolerance, autoFrames, autoSymmetric, autoBorder] = args; + const [ + xPos, + yPos, + width, + height, + autocrop, + autoTolerance, + autoFrames, + autoSymmetric, + autoBorder, + ] = args; if (!isImage(input)) { throw new OperationError("Invalid file type."); } @@ -108,20 +118,25 @@ class CropImage extends Operation { self.sendStatusMessage("Cropping image..."); if (autocrop) { image.autocrop({ - tolerance: (autoTolerance / 100), + tolerance: autoTolerance / 100, cropOnlyFrames: autoFrames, cropSymmetric: autoSymmetric, - leaveBorder: autoBorder + leaveBorder: autoBorder, }); } else { - image.crop(xPos, yPos, width, height); + image.crop({ + x: xPos, + y: yPos, + w: width, + h: height, + }); } let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { @@ -145,7 +160,6 @@ class CropImage extends Operation { return ``; } - } export default CropImage; diff --git a/src/core/operations/DitherImage.mjs b/src/core/operations/DitherImage.mjs index 17051480..f21c1f88 100644 --- a/src/core/operations/DitherImage.mjs +++ b/src/core/operations/DitherImage.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Image Dither operation */ class DitherImage extends Operation { - /** * DitherImage constructor */ @@ -51,17 +50,19 @@ class DitherImage extends Operation { try { if (isWorkerEnvironment()) self.sendStatusMessage("Applying dither to image..."); - image.dither565(); + image.dither(); let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { - throw new OperationError(`Error applying dither to image. (${err})`); + throw new OperationError( + `Error applying dither to image. (${err})`, + ); } } @@ -81,7 +82,6 @@ class DitherImage extends Operation { return ``; } - } export default DitherImage; diff --git a/src/core/operations/EscapeUnicodeCharacters.mjs b/src/core/operations/EscapeUnicodeCharacters.mjs index db2680c0..08d68581 100644 --- a/src/core/operations/EscapeUnicodeCharacters.mjs +++ b/src/core/operations/EscapeUnicodeCharacters.mjs @@ -44,23 +44,6 @@ class EscapeUnicodeCharacters extends Operation { "value": true } ]; - this.checks = [ - { - pattern: "\\\\u(?:[\\da-f]{4,6})", - flags: "i", - args: ["\\u"] - }, - { - pattern: "%u(?:[\\da-f]{4,6})", - flags: "i", - args: ["%u"] - }, - { - pattern: "U\\+(?:[\\da-f]{4,6})", - flags: "i", - args: ["U+"] - } - ]; } /** diff --git a/src/core/operations/ExtractLSB.mjs b/src/core/operations/ExtractLSB.mjs index d5c80406..e64831b1 100644 --- a/src/core/operations/ExtractLSB.mjs +++ b/src/core/operations/ExtractLSB.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import Utils from "../Utils.mjs"; import { fromBinary } from "../lib/Binary.mjs"; import { isImage } from "../lib/FileType.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp } from "jimp"; /** * Extract LSB operation */ class ExtractLSB extends Operation { - /** * ExtractLSB constructor */ @@ -24,8 +23,10 @@ class ExtractLSB extends Operation { this.name = "Extract LSB"; this.module = "Image"; - this.description = "Extracts the Least Significant Bit data from each pixel in an image. This is a common way to hide data in Steganography."; - this.infoURL = "https://wikipedia.org/wiki/Bit_numbering#Least_significant_bit_in_digital_steganography"; + this.description = + "Extracts the Least Significant Bit data from each pixel in an image. This is a common way to hide data in Steganography."; + this.infoURL = + "https://wikipedia.org/wiki/Bit_numbering#Least_significant_bit_in_digital_steganography"; this.inputType = "ArrayBuffer"; this.outputType = "byteArray"; this.args = [ @@ -57,8 +58,8 @@ class ExtractLSB extends Operation { { name: "Bit", type: "number", - value: 0 - } + value: 0, + }, ]; } @@ -68,21 +69,27 @@ class ExtractLSB extends Operation { * @returns {byteArray} */ async run(input, args) { - if (!isImage(input)) throw new OperationError("Please enter a valid image file."); + if (!isImage(input)) + throw new OperationError("Please enter a valid image file."); const bit = 7 - args.pop(), pixelOrder = args.pop(), - colours = args.filter(option => option !== "").map(option => COLOUR_OPTIONS.indexOf(option)), + colours = args + .filter((option) => option !== "") + .map((option) => COLOUR_OPTIONS.indexOf(option)), parsedImage = await Jimp.read(input), width = parsedImage.bitmap.width, height = parsedImage.bitmap.height, rgba = parsedImage.bitmap.data; if (bit < 0 || bit > 7) { - throw new OperationError("Error: Bit argument must be between 0 and 7"); + throw new OperationError( + "Error: Bit argument must be between 0 and 7", + ); } - let i, combinedBinary = ""; + let i, + combinedBinary = ""; if (pixelOrder === "Row") { for (i = 0; i < rgba.length; i += 4) { @@ -106,7 +113,6 @@ class ExtractLSB extends Operation { return fromBinary(combinedBinary); } - } const COLOUR_OPTIONS = ["R", "G", "B", "A"]; diff --git a/src/core/operations/ExtractRGBA.mjs b/src/core/operations/ExtractRGBA.mjs index 3339a2a7..b0fe3888 100644 --- a/src/core/operations/ExtractRGBA.mjs +++ b/src/core/operations/ExtractRGBA.mjs @@ -7,15 +7,14 @@ import Operation from "../Operation.mjs"; import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp } from "jimp"; -import {RGBA_DELIM_OPTIONS} from "../lib/Delim.mjs"; +import { RGBA_DELIM_OPTIONS } from "../lib/Delim.mjs"; /** * Extract RGBA operation */ class ExtractRGBA extends Operation { - /** * ExtractRGBA constructor */ @@ -24,7 +23,8 @@ class ExtractRGBA extends Operation { this.name = "Extract RGBA"; this.module = "Image"; - this.description = "Extracts each pixel's RGBA value in an image. These are sometimes used in Steganography to hide text or data."; + this.description = + "Extracts each pixel's RGBA value in an image. These are sometimes used in Steganography to hide text or data."; this.infoURL = "https://wikipedia.org/wiki/RGBA_color_space"; this.inputType = "ArrayBuffer"; this.outputType = "string"; @@ -32,13 +32,13 @@ class ExtractRGBA extends Operation { { name: "Delimiter", type: "editableOption", - value: RGBA_DELIM_OPTIONS + value: RGBA_DELIM_OPTIONS, }, { name: "Include Alpha", type: "boolean", - value: true - } + value: true, + }, ]; } @@ -48,18 +48,20 @@ class ExtractRGBA extends Operation { * @returns {string} */ async run(input, args) { - if (!isImage(input)) throw new OperationError("Please enter a valid image file."); + if (!isImage(input)) + throw new OperationError("Please enter a valid image file."); const delimiter = args[0], includeAlpha = args[1], parsedImage = await Jimp.read(input); let bitmap = parsedImage.bitmap.data; - bitmap = includeAlpha ? bitmap : bitmap.filter((val, idx) => idx % 4 !== 3); + bitmap = includeAlpha ? + bitmap : + bitmap.filter((val, idx) => idx % 4 !== 3); return bitmap.join(delimiter); } - } export default ExtractRGBA; diff --git a/src/core/operations/FlipImage.mjs b/src/core/operations/FlipImage.mjs index f4b7cba9..cf9c747f 100644 --- a/src/core/operations/FlipImage.mjs +++ b/src/core/operations/FlipImage.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Flip Image operation */ class FlipImage extends Operation { - /** * FlipImage constructor */ @@ -33,8 +32,8 @@ class FlipImage extends Operation { { name: "Axis", type: "option", - value: ["Horizontal", "Vertical"] - } + value: ["Horizontal", "Vertical"], + }, ]; } @@ -60,18 +59,24 @@ class FlipImage extends Operation { self.sendStatusMessage("Flipping image..."); switch (flipAxis) { case "Horizontal": - image.flip(true, false); + image.flip({ + horizontal: true, + vertical: false, + }); break; case "Vertical": - image.flip(false, true); + image.flip({ + horizontal: false, + vertical: true, + }); break; } let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { @@ -95,7 +100,6 @@ class FlipImage extends Operation { return ``; } - } export default FlipImage; diff --git a/src/core/operations/FromBech32.mjs b/src/core/operations/FromBech32.mjs new file mode 100644 index 00000000..8a01d4db --- /dev/null +++ b/src/core/operations/FromBech32.mjs @@ -0,0 +1,149 @@ +/** + * @author Medjedtxm + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import { decode } from "../lib/Bech32.mjs"; +import { toHex } from "../lib/Hex.mjs"; + +/** + * From Bech32 operation + */ +class FromBech32 extends Operation { + + /** + * FromBech32 constructor + */ + constructor() { + super(); + + this.name = "From Bech32"; + this.module = "Default"; + this.description = "Bech32 is an encoding scheme primarily used for Bitcoin SegWit addresses (BIP-0173). It uses a 32-character alphabet that excludes easily confused characters (1, b, i, o) and includes a checksum for error detection.

Bech32m (BIP-0350) is an updated version used for Bitcoin Taproot addresses.

Auto-detect will attempt Bech32 first, then Bech32m if the checksum fails.

Output format options allow you to see the Human-Readable Part (HRP) along with the decoded data."; + this.infoURL = "https://wikipedia.org/wiki/Bech32"; + this.inputType = "string"; + this.outputType = "string"; + this.args = [ + { + "name": "Encoding", + "type": "option", + "value": ["Auto-detect", "Bech32", "Bech32m"] + }, + { + "name": "Output Format", + "type": "option", + "value": ["Raw", "Hex", "Bitcoin scriptPubKey", "HRP: Hex", "JSON"] + } + ]; + this.checks = [ + { + // Bitcoin mainnet SegWit/Taproot addresses + pattern: "^bc1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{6,87}$", + flags: "i", + args: ["Auto-detect", "Hex"] + }, + { + // Bitcoin testnet addresses + pattern: "^tb1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{6,87}$", + flags: "i", + args: ["Auto-detect", "Hex"] + }, + { + // AGE public keys + pattern: "^age1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{6,87}$", + flags: "i", + args: ["Auto-detect", "HRP: Hex"] + }, + { + // AGE secret keys + pattern: "^AGE-SECRET-KEY-1[QPZRY9X8GF2TVDW0S3JN54KHCE6MUA7L]{6,87}$", + flags: "", + args: ["Auto-detect", "HRP: Hex"] + }, + { + // Litecoin mainnet addresses + pattern: "^ltc1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{6,87}$", + flags: "i", + args: ["Auto-detect", "Hex"] + }, + { + // Generic bech32 pattern + pattern: "^[a-z]{1,83}1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{6,}$", + flags: "i", + args: ["Auto-detect", "Hex"] + } + ]; + } + + /** + * @param {string} input + * @param {Object[]} args + * @returns {string} + */ + run(input, args) { + const encoding = args[0]; + const outputFormat = args[1]; + + input = input.trim(); + + if (input.length === 0) { + return ""; + } + + const decoded = decode(input, encoding); + + // Format output based on selected option + switch (outputFormat) { + case "Raw": + return decoded.data.map(b => String.fromCharCode(b)).join(""); + + case "Hex": + return toHex(decoded.data, ""); + + case "Bitcoin scriptPubKey": { + // Convert to Bitcoin scriptPubKey format as shown in BIP-0173/BIP-0350 + // Format: [OP_version][length][witness_program] + // OP_0 = 0x00, OP_1-OP_16 = 0x51-0x60 + if (decoded.witnessVersion === null || decoded.data.length < 2) { + // Not a SegWit address, fall back to hex + return toHex(decoded.data, ""); + } + const witnessVersion = decoded.data[0]; + const witnessProgram = decoded.data.slice(1); + + // Convert witness version to OP code + let opCode; + if (witnessVersion === 0) { + opCode = 0x00; // OP_0 + } else if (witnessVersion >= 1 && witnessVersion <= 16) { + opCode = 0x50 + witnessVersion; // OP_1 = 0x51, ..., OP_16 = 0x60 + } else { + // Invalid witness version, fall back to hex + return toHex(decoded.data, ""); + } + + // Build scriptPubKey: [OP_version][length][program] + const scriptPubKey = [opCode, witnessProgram.length, ...witnessProgram]; + return toHex(scriptPubKey, ""); + } + + case "HRP: Hex": + return `${decoded.hrp}: ${toHex(decoded.data, "")}`; + + case "JSON": + return JSON.stringify({ + hrp: decoded.hrp, + encoding: decoded.encoding, + data: toHex(decoded.data, "") + }, null, 2); + + default: + return toHex(decoded.data, ""); + } + } + +} + +export default FromBech32; diff --git a/src/core/operations/FromHexdump.mjs b/src/core/operations/FromHexdump.mjs index e8c25441..6fd3c1dc 100644 --- a/src/core/operations/FromHexdump.mjs +++ b/src/core/operations/FromHexdump.mjs @@ -43,7 +43,7 @@ class FromHexdump extends Operation { */ run(input, args) { const output = [], - regex = /^\s*(?:[\dA-F]{4,16}h?:?)?[ \t]+((?:[\dA-F]{2} ){1,8}(?:[ \t]|[\dA-F]{2}-)(?:[\dA-F]{2} ){1,8}|(?:[\dA-F]{4} )*[\dA-F]{4}|(?:[\dA-F]{2} )*[\dA-F]{2})/igm; + regex = /^\s*(?:[\dA-F]{4,16}h?:?)?[ \t]+((?:[\dA-F]{2} ){1,8}(?:[ \t]|[\dA-F]{2}-)(?:[\dA-F]{2} ){1,8}|(?:[\dA-F]{4} )+(?:[\dA-F]{2})?|(?:[\dA-F]{2} )*[\dA-F]{2})/igm; let block, line; while ((block = regex.exec(input))) { diff --git a/src/core/operations/FromQuotedPrintable.mjs b/src/core/operations/FromQuotedPrintable.mjs index 7dce45b6..4854c150 100644 --- a/src/core/operations/FromQuotedPrintable.mjs +++ b/src/core/operations/FromQuotedPrintable.mjs @@ -23,7 +23,7 @@ class FromQuotedPrintable extends Operation { this.name = "From Quoted Printable"; this.module = "Default"; - this.description = "Converts QP-encoded text back to standard text.

e.g. The quoted-printable encoded string hello=20world becomes hello world"; + this.description = "Converts QP-encoded text back to standard text. This format is a content transfer encoding common in email messages.

e.g. The quoted-printable encoded string hello=20world becomes hello world"; this.infoURL = "https://wikipedia.org/wiki/Quoted-printable"; this.inputType = "string"; this.outputType = "byteArray"; diff --git a/src/core/operations/GenerateImage.mjs b/src/core/operations/GenerateImage.mjs index 118e3a32..053e4ba1 100644 --- a/src/core/operations/GenerateImage.mjs +++ b/src/core/operations/GenerateImage.mjs @@ -7,16 +7,15 @@ import Operation from "../Operation.mjs"; import OperationError from "../errors/OperationError.mjs"; import Utils from "../Utils.mjs"; -import {isImage} from "../lib/FileType.mjs"; -import {toBase64} from "../lib/Base64.mjs"; -import {isWorkerEnvironment} from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { isImage } from "../lib/FileType.mjs"; +import { toBase64 } from "../lib/Base64.mjs"; +import { isWorkerEnvironment } from "../Utils.mjs"; +import { Jimp, JimpMime, ResizeStrategy, rgbaToInt } from "jimp"; /** * Generate Image operation */ class GenerateImage extends Operation { - /** * GenerateImage constructor */ @@ -25,27 +24,28 @@ class GenerateImage extends Operation { this.name = "Generate Image"; this.module = "Image"; - this.description = "Generates an image using the input as pixel values."; + this.description = + "Generates an image using the input as pixel values."; this.infoURL = ""; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; this.presentType = "html"; this.args = [ { - "name": "Mode", - "type": "option", - "value": ["Greyscale", "RG", "RGB", "RGBA", "Bits"] + name: "Mode", + type: "option", + value: ["Greyscale", "RG", "RGB", "RGBA", "Bits"], }, { - "name": "Pixel Scale Factor", - "type": "number", - "value": 8, + name: "Pixel Scale Factor", + type: "number", + value: 8, }, { - "name": "Pixels per row", - "type": "number", - "value": 64, - } + name: "Pixels per row", + type: "number", + value: 64, + }, ]; } @@ -67,21 +67,23 @@ class GenerateImage extends Operation { } const bytePerPixelMap = { - "Greyscale": 1, - "RG": 2, - "RGB": 3, - "RGBA": 4, - "Bits": 1/8, + Greyscale: 1, + RG: 2, + RGB: 3, + RGBA: 4, + Bits: 1 / 8, }; const bytesPerPixel = bytePerPixelMap[mode]; - if (bytesPerPixel > 0 && input.length % bytesPerPixel !== 0) { - throw new OperationError(`Number of bytes is not a divisor of ${bytesPerPixel}`); + if (bytesPerPixel > 0 && input.length % bytesPerPixel !== 0) { + throw new OperationError( + `Number of bytes is not a divisor of ${bytesPerPixel}`, + ); } const height = Math.ceil(input.length / bytesPerPixel / width); - const image = await new Jimp(width, height, (err, image) => {}); + const image = new Jimp({ width, height }); if (isWorkerEnvironment()) self.sendStatusMessage("Generating image from data..."); @@ -94,8 +96,8 @@ class GenerateImage extends Operation { const x = index % width; const y = Math.floor(index / width); - const value = curByte[k] === "0" ? 0xFF : 0x00; - const pixel = Jimp.rgbaToInt(value, value, value, 0xFF); + const value = curByte[k] === "0" ? 0xff : 0x00; + const pixel = rgbaToInt(value, value, value, 0xff); image.setPixelColor(pixel, x, y); } } @@ -109,7 +111,7 @@ class GenerateImage extends Operation { let red = 0x00; let green = 0x00; let blue = 0x00; - let alpha = 0xFF; + let alpha = 0xff; switch (mode) { case "Greyscale": @@ -139,10 +141,12 @@ class GenerateImage extends Operation { } try { - const pixel = Jimp.rgbaToInt(red, green, blue, alpha); + const pixel = rgbaToInt(red, green, blue, alpha); image.setPixelColor(pixel, x, y); } catch (err) { - throw new OperationError(`Error while generating image from pixel values. (${err})`); + throw new OperationError( + `Error while generating image from pixel values. (${err})`, + ); } } } @@ -151,11 +155,15 @@ class GenerateImage extends Operation { if (isWorkerEnvironment()) self.sendStatusMessage("Scaling image..."); - image.scaleToFit(width*scale, height*scale, Jimp.RESIZE_NEAREST_NEIGHBOR); + image.scaleToFit({ + w: width * scale, + h: height * scale, + mode: ResizeStrategy.NEAREST_NEIGHBOR, + }); } try { - const imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + const imageBuffer = await image.getBuffer(JimpMime.png); return imageBuffer.buffer; } catch (err) { throw new OperationError(`Error generating image. (${err})`); @@ -178,7 +186,6 @@ class GenerateImage extends Operation { return ``; } - } export default GenerateImage; diff --git a/src/core/operations/ImageBrightnessContrast.mjs b/src/core/operations/ImageBrightnessContrast.mjs index bb0541ab..b15503d4 100644 --- a/src/core/operations/ImageBrightnessContrast.mjs +++ b/src/core/operations/ImageBrightnessContrast.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Image Brightness / Contrast operation */ class ImageBrightnessContrast extends Operation { - /** * ImageBrightnessContrast constructor */ @@ -35,15 +34,15 @@ class ImageBrightnessContrast extends Operation { type: "number", value: 0, min: -100, - max: 100 + max: 100, }, { name: "Contrast", type: "number", value: 0, min: -100, - max: 100 - } + max: 100, + }, ]; } @@ -77,14 +76,16 @@ class ImageBrightnessContrast extends Operation { } let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { - throw new OperationError(`Error adjusting image brightness or contrast. (${err})`); + throw new OperationError( + `Error adjusting image brightness or contrast. (${err})`, + ); } } @@ -104,7 +105,6 @@ class ImageBrightnessContrast extends Operation { return ``; } - } export default ImageBrightnessContrast; diff --git a/src/core/operations/ImageFilter.mjs b/src/core/operations/ImageFilter.mjs index ed47bd2a..c7c4dde2 100644 --- a/src/core/operations/ImageFilter.mjs +++ b/src/core/operations/ImageFilter.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Image Filter operation */ class ImageFilter extends Operation { - /** * ImageFilter constructor */ @@ -33,11 +32,8 @@ class ImageFilter extends Operation { { name: "Filter type", type: "option", - value: [ - "Greyscale", - "Sepia" - ] - } + value: ["Greyscale", "Sepia"], + }, ]; } @@ -60,7 +56,11 @@ class ImageFilter extends Operation { } try { if (isWorkerEnvironment()) - self.sendStatusMessage("Applying " + filterType.toLowerCase() + " filter to image..."); + self.sendStatusMessage( + "Applying " + + filterType.toLowerCase() + + " filter to image...", + ); if (filterType === "Greyscale") { image.greyscale(); } else { @@ -68,14 +68,16 @@ class ImageFilter extends Operation { } let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { - throw new OperationError(`Error applying filter to image. (${err})`); + throw new OperationError( + `Error applying filter to image. (${err})`, + ); } } @@ -95,7 +97,6 @@ class ImageFilter extends Operation { return ``; } - } export default ImageFilter; diff --git a/src/core/operations/ImageHueSaturationLightness.mjs b/src/core/operations/ImageHueSaturationLightness.mjs index a008c8f3..e0a1910a 100644 --- a/src/core/operations/ImageHueSaturationLightness.mjs +++ b/src/core/operations/ImageHueSaturationLightness.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Image Hue/Saturation/Lightness operation */ class ImageHueSaturationLightness extends Operation { - /** * ImageHueSaturationLightness constructor */ @@ -24,7 +23,8 @@ class ImageHueSaturationLightness extends Operation { this.name = "Image Hue/Saturation/Lightness"; this.module = "Image"; - this.description = "Adjusts the hue / saturation / lightness (HSL) values of an image."; + this.description = + "Adjusts the hue / saturation / lightness (HSL) values of an image."; this.infoURL = ""; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; @@ -35,22 +35,22 @@ class ImageHueSaturationLightness extends Operation { type: "number", value: 0, min: -360, - max: 360 + max: 360, }, { name: "Saturation", type: "number", value: 0, min: -100, - max: 100 + max: 100, }, { name: "Lightness", type: "number", value: 0, min: -100, - max: 100 - } + max: 100, + }, ]; } @@ -76,43 +76,45 @@ class ImageHueSaturationLightness extends Operation { if (hue !== 0) { if (isWorkerEnvironment()) self.sendStatusMessage("Changing image hue..."); - image.colour([ + image.color([ { apply: "hue", - params: [hue] - } + params: [hue], + }, ]); } if (saturation !== 0) { if (isWorkerEnvironment()) self.sendStatusMessage("Changing image saturation..."); - image.colour([ + image.color([ { apply: "saturate", - params: [saturation] - } + params: [saturation], + }, ]); } if (lightness !== 0) { if (isWorkerEnvironment()) self.sendStatusMessage("Changing image lightness..."); - image.colour([ + image.color([ { apply: "lighten", - params: [lightness] - } + params: [lightness], + }, ]); } let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { - throw new OperationError(`Error adjusting image hue / saturation / lightness. (${err})`); + throw new OperationError( + `Error adjusting image hue / saturation / lightness. (${err})`, + ); } } diff --git a/src/core/operations/ImageOpacity.mjs b/src/core/operations/ImageOpacity.mjs index fc0a23e7..4650b8d6 100644 --- a/src/core/operations/ImageOpacity.mjs +++ b/src/core/operations/ImageOpacity.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Image Opacity operation */ class ImageOpacity extends Operation { - /** * ImageOpacity constructor */ @@ -35,8 +34,8 @@ class ImageOpacity extends Operation { type: "number", value: 100, min: 0, - max: 100 - } + max: 100, + }, ]; } @@ -63,10 +62,10 @@ class ImageOpacity extends Operation { image.opacity(opacity / 100); let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { @@ -90,7 +89,6 @@ class ImageOpacity extends Operation { return ``; } - } export default ImageOpacity; diff --git a/src/core/operations/InvertImage.mjs b/src/core/operations/InvertImage.mjs index 0036564f..cbf46748 100644 --- a/src/core/operations/InvertImage.mjs +++ b/src/core/operations/InvertImage.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Invert Image operation */ class InvertImage extends Operation { - /** * InvertImage constructor */ @@ -54,10 +53,10 @@ class InvertImage extends Operation { image.invert(); let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { @@ -81,7 +80,6 @@ class InvertImage extends Operation { return ``; } - } export default InvertImage; diff --git a/src/core/operations/NormaliseImage.mjs b/src/core/operations/NormaliseImage.mjs index e67570bc..9773761b 100644 --- a/src/core/operations/NormaliseImage.mjs +++ b/src/core/operations/NormaliseImage.mjs @@ -8,13 +8,12 @@ import Operation from "../Operation.mjs"; import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Normalise Image operation */ class NormaliseImage extends Operation { - /** * NormaliseImage constructor */ @@ -27,7 +26,7 @@ class NormaliseImage extends Operation { this.infoURL = ""; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; - this.presentType= "html"; + this.presentType = "html"; this.args = []; } @@ -52,10 +51,10 @@ class NormaliseImage extends Operation { image.normalize(); let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { @@ -79,7 +78,6 @@ class NormaliseImage extends Operation { return ``; } - } export default NormaliseImage; diff --git a/src/core/operations/ParseQRCode.mjs b/src/core/operations/ParseQRCode.mjs index 77ab7d21..89eaddee 100644 --- a/src/core/operations/ParseQRCode.mjs +++ b/src/core/operations/ParseQRCode.mjs @@ -13,7 +13,6 @@ import { parseQrCode } from "../lib/QRCode.mjs"; * Parse QR Code operation */ class ParseQRCode extends Operation { - /** * ParseQRCode constructor */ @@ -22,24 +21,26 @@ class ParseQRCode extends Operation { this.name = "Parse QR Code"; this.module = "Image"; - this.description = "Reads an image file and attempts to detect and read a Quick Response (QR) code from the image.

Normalise Image
Attempts to normalise the image before parsing it to improve detection of a QR code."; + this.description = + "Reads an image file and attempts to detect and read a Quick Response (QR) code from the image.

Normalise Image
Attempts to normalise the image before parsing it to improve detection of a QR code."; this.infoURL = "https://wikipedia.org/wiki/QR_code"; this.inputType = "ArrayBuffer"; this.outputType = "string"; this.args = [ { - "name": "Normalise image", - "type": "boolean", - "value": false - } + name: "Normalise image", + type: "boolean", + value: false, + }, ]; this.checks = [ { - "pattern": "^(?:\\xff\\xd8\\xff|\\x89\\x50\\x4e\\x47|\\x47\\x49\\x46|.{8}\\x57\\x45\\x42\\x50|\\x42\\x4d)", - "flags": "", - "args": [false], - "useful": true - } + pattern: + "^(?:\\xff\\xd8\\xff|\\x89\\x50\\x4e\\x47|\\x47\\x49\\x46|.{8}\\x57\\x45\\x42\\x50|\\x42\\x4d)", + flags: "", + args: [false], + useful: true, + }, ]; } @@ -54,9 +55,8 @@ class ParseQRCode extends Operation { if (!isImage(input)) { throw new OperationError("Invalid file type."); } - return await parseQrCode(input, normalise); + return parseQrCode(input, normalise); } - } export default ParseQRCode; diff --git a/src/core/operations/RandomizeColourPalette.mjs b/src/core/operations/RandomizeColourPalette.mjs index fa8fa59e..186023c2 100644 --- a/src/core/operations/RandomizeColourPalette.mjs +++ b/src/core/operations/RandomizeColourPalette.mjs @@ -10,13 +10,12 @@ import Utils from "../Utils.mjs"; import { isImage } from "../lib/FileType.mjs"; import { runHash } from "../lib/Hash.mjs"; import { toBase64 } from "../lib/Base64.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp } from "jimp"; /** * Randomize Colour Palette operation */ class RandomizeColourPalette extends Operation { - /** * RandomizeColourPalette constructor */ @@ -25,7 +24,8 @@ class RandomizeColourPalette extends Operation { this.name = "Randomize Colour Palette"; this.module = "Image"; - this.description = "Randomizes each colour in an image's colour palette. This can often reveal text or symbols that were previously a very similar colour to their surroundings, a technique sometimes used in Steganography."; + this.description = + "Randomizes each colour in an image's colour palette. This can often reveal text or symbols that were previously a very similar colour to their surroundings, a technique sometimes used in Steganography."; this.infoURL = "https://wikipedia.org/wiki/Indexed_color"; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; @@ -34,8 +34,8 @@ class RandomizeColourPalette extends Operation { { name: "Seed", type: "string", - value: "" - } + value: "", + }, ]; } @@ -45,23 +45,24 @@ class RandomizeColourPalette extends Operation { * @returns {ArrayBuffer} */ async run(input, args) { - if (!isImage(input)) throw new OperationError("Please enter a valid image file."); + if (!isImage(input)) + throw new OperationError("Please enter a valid image file."); - const seed = args[0] || (Math.random().toString().substr(2)), + const seed = args[0] || Math.random().toString().substr(2), parsedImage = await Jimp.read(input), width = parsedImage.bitmap.width, height = parsedImage.bitmap.height; let rgbString, rgbHash, rgbHex; - parsedImage.scan(0, 0, width, height, function(x, y, idx) { - rgbString = this.bitmap.data.slice(idx, idx+3).join("."); + parsedImage.scan(0, 0, width, height, function (x, y, idx) { + rgbString = this.bitmap.data.slice(idx, idx + 3).join("."); rgbHash = runHash("md5", Utils.strToArrayBuffer(seed + rgbString)); rgbHex = rgbHash.substr(0, 6) + "ff"; parsedImage.setPixelColor(parseInt(rgbHex, 16), x, y); }); - const imageBuffer = await parsedImage.getBufferAsync(Jimp.AUTO); + const imageBuffer = await parsedImage.getBuffer(parsedImage.mime); return new Uint8Array(imageBuffer).buffer; } @@ -77,7 +78,6 @@ class RandomizeColourPalette extends Operation { return ``; } - } export default RandomizeColourPalette; diff --git a/src/core/operations/ResizeImage.mjs b/src/core/operations/ResizeImage.mjs index 2d2af045..bec07c4e 100644 --- a/src/core/operations/ResizeImage.mjs +++ b/src/core/operations/ResizeImage.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime, ResizeStrategy } from "jimp"; /** * Resize Image operation */ class ResizeImage extends Operation { - /** * ResizeImage constructor */ @@ -24,7 +23,8 @@ class ResizeImage extends Operation { this.name = "Resize Image"; this.module = "Image"; - this.description = "Resizes an image to the specified width and height values."; + this.description = + "Resizes an image to the specified width and height values."; this.infoURL = "https://wikipedia.org/wiki/Image_scaling"; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; @@ -34,23 +34,23 @@ class ResizeImage extends Operation { name: "Width", type: "number", value: 100, - min: 1 + min: 1, }, { name: "Height", type: "number", value: 100, - min: 1 + min: 1, }, { name: "Unit type", type: "option", - value: ["Pixels", "Percent"] + value: ["Pixels", "Percent"], }, { name: "Maintain aspect ratio", type: "boolean", - value: false + value: false, }, { name: "Resizing algorithm", @@ -60,10 +60,10 @@ class ResizeImage extends Operation { "Bilinear", "Bicubic", "Hermite", - "Bezier" + "Bezier", ], - defaultIndex: 1 - } + defaultIndex: 1, + }, ]; } @@ -80,11 +80,11 @@ class ResizeImage extends Operation { resizeAlg = args[4]; const resizeMap = { - "Nearest Neighbour": Jimp.RESIZE_NEAREST_NEIGHBOR, - "Bilinear": Jimp.RESIZE_BILINEAR, - "Bicubic": Jimp.RESIZE_BICUBIC, - "Hermite": Jimp.RESIZE_HERMITE, - "Bezier": Jimp.RESIZE_BEZIER + "Nearest Neighbour": ResizeStrategy.NEAREST_NEIGHBOR, + Bilinear: ResizeStrategy.BILINEAR, + Bicubic: ResizeStrategy.BICUBIC, + Hermite: ResizeStrategy.HERMITE, + Bezier: ResizeStrategy.BEZIER, }; if (!isImage(input)) { @@ -99,23 +99,31 @@ class ResizeImage extends Operation { } try { if (unit === "Percent") { - width = image.getWidth() * (width / 100); - height = image.getHeight() * (height / 100); + width = image.width * (width / 100); + height = image.height * (height / 100); } if (isWorkerEnvironment()) self.sendStatusMessage("Resizing image..."); if (aspect) { - image.scaleToFit(width, height, resizeMap[resizeAlg]); + image.scaleToFit({ + w: width, + h: height, + mode: resizeMap[resizeAlg], + }); } else { - image.resize(width, height, resizeMap[resizeAlg]); + image.resize({ + w: width, + h: height, + mode: resizeMap[resizeAlg], + }); } let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { @@ -139,7 +147,6 @@ class ResizeImage extends Operation { return ``; } - } export default ResizeImage; diff --git a/src/core/operations/RotateImage.mjs b/src/core/operations/RotateImage.mjs index 894ec785..5a96ffab 100644 --- a/src/core/operations/RotateImage.mjs +++ b/src/core/operations/RotateImage.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Rotate Image operation */ class RotateImage extends Operation { - /** * RotateImage constructor */ @@ -24,7 +23,8 @@ class RotateImage extends Operation { this.name = "Rotate Image"; this.module = "Image"; - this.description = "Rotates an image by the specified number of degrees."; + this.description = + "Rotates an image by the specified number of degrees."; this.infoURL = ""; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; @@ -33,8 +33,8 @@ class RotateImage extends Operation { { name: "Rotation amount (degrees)", type: "number", - value: 90 - } + value: 90, + }, ]; } @@ -62,10 +62,10 @@ class RotateImage extends Operation { image.rotate(degrees); let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { @@ -89,7 +89,6 @@ class RotateImage extends Operation { return ``; } - } export default RotateImage; diff --git a/src/core/operations/SharpenImage.mjs b/src/core/operations/SharpenImage.mjs index 5cf6b606..1f5461f2 100644 --- a/src/core/operations/SharpenImage.mjs +++ b/src/core/operations/SharpenImage.mjs @@ -8,15 +8,13 @@ import Operation from "../Operation.mjs"; import OperationError from "../errors/OperationError.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; -import { gaussianBlur } from "../lib/ImageManipulation.mjs"; import { isWorkerEnvironment } from "../Utils.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp, JimpMime } from "jimp"; /** * Sharpen Image operation */ class SharpenImage extends Operation { - /** * SharpenImage constructor */ @@ -35,22 +33,22 @@ class SharpenImage extends Operation { name: "Radius", type: "number", value: 2, - min: 1 + min: 1, }, { name: "Amount", type: "number", value: 1, min: 0, - step: 0.1 + step: 0.1, }, { name: "Threshold", type: "number", value: 10, min: 0, - max: 100 - } + max: 100, + }, ]; } @@ -79,67 +77,102 @@ class SharpenImage extends Operation { const blurMask = image.clone(); if (isWorkerEnvironment()) - self.sendStatusMessage("Sharpening image... (Blurring cloned image)"); - const blurImage = gaussianBlur(image.clone(), radius); - + self.sendStatusMessage( + "Sharpening image... (Blurring cloned image)", + ); + const blurImage = image.clone().gaussian(radius); if (isWorkerEnvironment()) - self.sendStatusMessage("Sharpening image... (Creating unsharp mask)"); - blurMask.scan(0, 0, blurMask.bitmap.width, blurMask.bitmap.height, function(x, y, idx) { - const blurRed = blurImage.bitmap.data[idx]; - const blurGreen = blurImage.bitmap.data[idx + 1]; - const blurBlue = blurImage.bitmap.data[idx + 2]; + self.sendStatusMessage( + "Sharpening image... (Creating unsharp mask)", + ); + blurMask.scan( + 0, + 0, + blurMask.bitmap.width, + blurMask.bitmap.height, + function (x, y, idx) { + const blurRed = blurImage.bitmap.data[idx]; + const blurGreen = blurImage.bitmap.data[idx + 1]; + const blurBlue = blurImage.bitmap.data[idx + 2]; - const normalRed = this.bitmap.data[idx]; - const normalGreen = this.bitmap.data[idx + 1]; - const normalBlue = this.bitmap.data[idx + 2]; + const normalRed = this.bitmap.data[idx]; + const normalGreen = this.bitmap.data[idx + 1]; + const normalBlue = this.bitmap.data[idx + 2]; - // Subtract blurred pixel value from normal image - this.bitmap.data[idx] = (normalRed > blurRed) ? normalRed - blurRed : 0; - this.bitmap.data[idx + 1] = (normalGreen > blurGreen) ? normalGreen - blurGreen : 0; - this.bitmap.data[idx + 2] = (normalBlue > blurBlue) ? normalBlue - blurBlue : 0; - }); + // Subtract blurred pixel value from normal image + this.bitmap.data[idx] = + normalRed > blurRed ? normalRed - blurRed : 0; + this.bitmap.data[idx + 1] = + normalGreen > blurGreen ? normalGreen - blurGreen : 0; + this.bitmap.data[idx + 2] = + normalBlue > blurBlue ? normalBlue - blurBlue : 0; + }, + ); if (isWorkerEnvironment()) - self.sendStatusMessage("Sharpening image... (Merging with unsharp mask)"); - image.scan(0, 0, image.bitmap.width, image.bitmap.height, function(x, y, idx) { - let maskRed = blurMask.bitmap.data[idx]; - let maskGreen = blurMask.bitmap.data[idx + 1]; - let maskBlue = blurMask.bitmap.data[idx + 2]; + self.sendStatusMessage( + "Sharpening image... (Merging with unsharp mask)", + ); + image.scan( + 0, + 0, + image.bitmap.width, + image.bitmap.height, + function (x, y, idx) { + let maskRed = blurMask.bitmap.data[idx]; + let maskGreen = blurMask.bitmap.data[idx + 1]; + let maskBlue = blurMask.bitmap.data[idx + 2]; - const normalRed = this.bitmap.data[idx]; - const normalGreen = this.bitmap.data[idx + 1]; - const normalBlue = this.bitmap.data[idx + 2]; + const normalRed = this.bitmap.data[idx]; + const normalGreen = this.bitmap.data[idx + 1]; + const normalBlue = this.bitmap.data[idx + 2]; - // Calculate luminance - const maskLuminance = (0.2126 * maskRed + 0.7152 * maskGreen + 0.0722 * maskBlue); - const normalLuminance = (0.2126 * normalRed + 0.7152 * normalGreen + 0.0722 * normalBlue); + // Calculate luminance + const maskLuminance = + 0.2126 * maskRed + + 0.7152 * maskGreen + + 0.0722 * maskBlue; + const normalLuminance = + 0.2126 * normalRed + + 0.7152 * normalGreen + + 0.0722 * normalBlue; - let luminanceDiff; - if (maskLuminance > normalLuminance) { - luminanceDiff = maskLuminance - normalLuminance; - } else { - luminanceDiff = normalLuminance - maskLuminance; - } + let luminanceDiff; + if (maskLuminance > normalLuminance) { + luminanceDiff = maskLuminance - normalLuminance; + } else { + luminanceDiff = normalLuminance - maskLuminance; + } - // Scale mask colours by amount - maskRed = maskRed * amount; - maskGreen = maskGreen * amount; - maskBlue = maskBlue * amount; + // Scale mask colours by amount + maskRed = maskRed * amount; + maskGreen = maskGreen * amount; + maskBlue = maskBlue * amount; - // Only change pixel value if the difference is higher than threshold - if ((luminanceDiff / 255) * 100 >= threshold) { - this.bitmap.data[idx] = (normalRed + maskRed) <= 255 ? normalRed + maskRed : 255; - this.bitmap.data[idx + 1] = (normalGreen + maskGreen) <= 255 ? normalGreen + maskGreen : 255; - this.bitmap.data[idx + 2] = (normalBlue + maskBlue) <= 255 ? normalBlue + maskBlue : 255; - } - }); + // Only change pixel value if the difference is higher than threshold + if ((luminanceDiff / 255) * 100 >= threshold) { + this.bitmap.data[idx] = + normalRed + maskRed <= 255 ? + normalRed + maskRed : + 255; + this.bitmap.data[idx + 1] = + normalGreen + maskGreen <= 255 ? + normalGreen + maskGreen : + 255; + this.bitmap.data[idx + 2] = + normalBlue + maskBlue <= 255 ? + normalBlue + maskBlue : + 255; + } + }, + ); let imageBuffer; - if (image.getMIME() === "image/gif") { - imageBuffer = await image.getBufferAsync(Jimp.MIME_PNG); + if (image.mime === "image/gif") { + imageBuffer = await image.getBuffer(JimpMime.png); } else { - imageBuffer = await image.getBufferAsync(Jimp.AUTO); + imageBuffer = await image.getBuffer(image.mime); } return imageBuffer.buffer; } catch (err) { @@ -163,7 +196,6 @@ class SharpenImage extends Operation { return ``; } - } export default SharpenImage; diff --git a/src/core/operations/SplitColourChannels.mjs b/src/core/operations/SplitColourChannels.mjs index d5a26a2d..3a33b78c 100644 --- a/src/core/operations/SplitColourChannels.mjs +++ b/src/core/operations/SplitColourChannels.mjs @@ -7,14 +7,13 @@ import Operation from "../Operation.mjs"; import OperationError from "../errors/OperationError.mjs"; import Utils from "../Utils.mjs"; -import {isImage} from "../lib/FileType.mjs"; -import Jimp from "jimp/es/index.js"; +import { isImage } from "../lib/FileType.mjs"; +import { Jimp, JimpMime } from "jimp"; /** * Split Colour Channels operation */ class SplitColourChannels extends Operation { - /** * SplitColourChannels constructor */ @@ -23,7 +22,8 @@ class SplitColourChannels extends Operation { this.name = "Split Colour Channels"; this.module = "Image"; - this.description = "Splits the given image into its red, green and blue colour channels."; + this.description = + "Splits the given image into its red, green and blue colour channels."; this.infoURL = "https://wikipedia.org/wiki/Channel_(digital_image)"; this.inputType = "ArrayBuffer"; this.outputType = "List"; @@ -48,26 +48,44 @@ class SplitColourChannels extends Operation { const split = parsedImage .clone() .color([ - {apply: "blue", params: [-255]}, - {apply: "green", params: [-255]} + { apply: "blue", params: [-255] }, + { apply: "green", params: [-255] }, ]) - .getBufferAsync(Jimp.MIME_PNG); - resolve(new File([new Uint8Array((await split).values())], "red.png", {type: "image/png"})); + .getBuffer(JimpMime.png); + resolve( + new File( + [new Uint8Array((await split).values())], + "red.png", + { type: "image/png" }, + ), + ); } catch (err) { - reject(new OperationError(`Could not split red channel: ${err}`)); + reject( + new OperationError(`Could not split red channel: ${err}`), + ); } }); const green = new Promise(async (resolve, reject) => { try { - const split = parsedImage.clone() + const split = parsedImage + .clone() .color([ - {apply: "red", params: [-255]}, - {apply: "blue", params: [-255]}, - ]).getBufferAsync(Jimp.MIME_PNG); - resolve(new File([new Uint8Array((await split).values())], "green.png", {type: "image/png"})); + { apply: "red", params: [-255] }, + { apply: "blue", params: [-255] }, + ]) + .getBuffer(JimpMime.png); + resolve( + new File( + [new Uint8Array((await split).values())], + "green.png", + { type: "image/png" }, + ), + ); } catch (err) { - reject(new OperationError(`Could not split green channel: ${err}`)); + reject( + new OperationError(`Could not split green channel: ${err}`), + ); } }); @@ -75,12 +93,21 @@ class SplitColourChannels extends Operation { try { const split = parsedImage .color([ - {apply: "red", params: [-255]}, - {apply: "green", params: [-255]}, - ]).getBufferAsync(Jimp.MIME_PNG); - resolve(new File([new Uint8Array((await split).values())], "blue.png", {type: "image/png"})); + { apply: "red", params: [-255] }, + { apply: "green", params: [-255] }, + ]) + .getBuffer(JimpMime.png); + resolve( + new File( + [new Uint8Array((await split).values())], + "blue.png", + { type: "image/png" }, + ), + ); } catch (err) { - reject(new OperationError(`Could not split blue channel: ${err}`)); + reject( + new OperationError(`Could not split blue channel: ${err}`), + ); } }); @@ -96,7 +123,6 @@ class SplitColourChannels extends Operation { async present(files) { return await Utils.displayFilesAsHTML(files); } - } export default SplitColourChannels; diff --git a/src/core/operations/ToBase85.mjs b/src/core/operations/ToBase85.mjs index 839ef1e4..e9b0a485 100644 --- a/src/core/operations/ToBase85.mjs +++ b/src/core/operations/ToBase85.mjs @@ -33,7 +33,7 @@ class ToBase85 extends Operation { value: ALPHABET_OPTIONS }, { - name: "Include delimeter", + name: "Include delimiter", type: "boolean", value: false } diff --git a/src/core/operations/ToBech32.mjs b/src/core/operations/ToBech32.mjs new file mode 100644 index 00000000..a7c97355 --- /dev/null +++ b/src/core/operations/ToBech32.mjs @@ -0,0 +1,92 @@ +/** + * @author Medjedtxm + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ + +import Operation from "../Operation.mjs"; +import { encode } from "../lib/Bech32.mjs"; +import { fromHex } from "../lib/Hex.mjs"; + +/** + * To Bech32 operation + */ +class ToBech32 extends Operation { + + /** + * ToBech32 constructor + */ + constructor() { + super(); + + this.name = "To Bech32"; + this.module = "Default"; + this.description = "Bech32 is an encoding scheme primarily used for Bitcoin SegWit addresses (BIP-0173). It uses a 32-character alphabet that excludes easily confused characters (1, b, i, o) and includes a checksum for error detection.

Bech32m (BIP-0350) is an updated version that fixes a weakness in the original Bech32 checksum and is used for Bitcoin Taproot addresses.

The Human-Readable Part (HRP) identifies the network or purpose (e.g., 'bc' for Bitcoin mainnet, 'tb' for testnet, 'age' for AGE encryption keys).

Maximum output length is 90 characters as per specification."; + this.infoURL = "https://wikipedia.org/wiki/Bech32"; + this.inputType = "ArrayBuffer"; + this.outputType = "string"; + this.args = [ + { + "name": "Human-Readable Part (HRP)", + "type": "string", + "value": "bc" + }, + { + "name": "Encoding", + "type": "option", + "value": ["Bech32", "Bech32m"] + }, + { + "name": "Input Format", + "type": "option", + "value": ["Raw bytes", "Hex"] + }, + { + "name": "Mode", + "type": "option", + "value": ["Generic", "Bitcoin SegWit"] + }, + { + "name": "Witness Version", + "type": "number", + "value": 0, + "hint": "SegWit witness version (0-16). Only used in Bitcoin SegWit mode." + } + ]; + } + + /** + * @param {ArrayBuffer} input + * @param {Object[]} args + * @returns {string} + */ + run(input, args) { + const hrp = args[0]; + const encoding = args[1]; + const inputFormat = args[2]; + const mode = args[3]; + const witnessVersion = args[4]; + + let inputArray; + if (inputFormat === "Hex") { + // Convert hex string to bytes + const hexStr = new TextDecoder().decode(new Uint8Array(input)).replace(/\s/g, ""); + inputArray = fromHex(hexStr); + } else { + inputArray = new Uint8Array(input); + } + + if (mode === "Bitcoin SegWit") { + // Prepend witness version to the input data + const withVersion = new Uint8Array(inputArray.length + 1); + withVersion[0] = witnessVersion; + withVersion.set(inputArray, 1); + return encode(hrp, withVersion, encoding, true); + } + + return encode(hrp, inputArray, encoding, false); + } + +} + +export default ToBech32; diff --git a/src/core/operations/ToQuotedPrintable.mjs b/src/core/operations/ToQuotedPrintable.mjs index 9db5c5a5..2ea204f9 100644 --- a/src/core/operations/ToQuotedPrintable.mjs +++ b/src/core/operations/ToQuotedPrintable.mjs @@ -23,7 +23,7 @@ class ToQuotedPrintable extends Operation { this.name = "To Quoted Printable"; this.module = "Default"; - this.description = "Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in e-mail.

QP works by using the equals sign '=' as an escape character. It also limits line length to 76, as some software has limits on line length."; + this.description = "Quoted-Printable, or QP encoding, is an encoding using printable ASCII characters (alphanumeric and the equals sign '=') to transmit 8-bit data over a 7-bit data path or, generally, over a medium which is not 8-bit clean. It is defined as a MIME content transfer encoding for use in email.

QP works by using the equals sign '=' as an escape character. It also limits line length to 76, as some software has limits on line length."; this.infoURL = "https://wikipedia.org/wiki/Quoted-printable"; this.inputType = "ArrayBuffer"; this.outputType = "string"; diff --git a/src/core/operations/UnescapeUnicodeCharacters.mjs b/src/core/operations/UnescapeUnicodeCharacters.mjs index 5bb0e5ac..02d16662 100644 --- a/src/core/operations/UnescapeUnicodeCharacters.mjs +++ b/src/core/operations/UnescapeUnicodeCharacters.mjs @@ -30,6 +30,23 @@ class UnescapeUnicodeCharacters extends Operation { "value": ["\\u", "%u", "U+"] } ]; + this.checks = [ + { + pattern: "\\\\u(?:[\\da-f]{4,6})", + flags: "i", + args: ["\\u"] + }, + { + pattern: "%u(?:[\\da-f]{4,6})", + flags: "i", + args: ["%u"] + }, + { + pattern: "U\\+(?:[\\da-f]{4,6})", + flags: "i", + args: ["U+"] + } + ]; } /** diff --git a/src/core/operations/ViewBitPlane.mjs b/src/core/operations/ViewBitPlane.mjs index 8c93f16c..3740c10d 100644 --- a/src/core/operations/ViewBitPlane.mjs +++ b/src/core/operations/ViewBitPlane.mjs @@ -9,13 +9,12 @@ import OperationError from "../errors/OperationError.mjs"; import Utils from "../Utils.mjs"; import { isImage } from "../lib/FileType.mjs"; import { toBase64 } from "../lib/Base64.mjs"; -import Jimp from "jimp/es/index.js"; +import { Jimp } from "jimp"; /** * View Bit Plane operation */ class ViewBitPlane extends Operation { - /** * ViewBitPlane constructor */ @@ -24,7 +23,8 @@ class ViewBitPlane extends Operation { this.name = "View Bit Plane"; this.module = "Image"; - this.description = "Extracts and displays a bit plane of any given image. These show only a single bit from each pixel, and can be used to hide messages in Steganography."; + this.description = + "Extracts and displays a bit plane of any given image. These show only a single bit from each pixel, and can be used to hide messages in Steganography."; this.infoURL = "https://wikipedia.org/wiki/Bit_plane"; this.inputType = "ArrayBuffer"; this.outputType = "ArrayBuffer"; @@ -33,13 +33,13 @@ class ViewBitPlane extends Operation { { name: "Colour", type: "option", - value: COLOUR_OPTIONS + value: COLOUR_OPTIONS, }, { name: "Bit", type: "number", - value: 0 - } + value: 0, + }, ]; } @@ -49,36 +49,38 @@ class ViewBitPlane extends Operation { * @returns {ArrayBuffer} */ async run(input, args) { - if (!isImage(input)) throw new OperationError("Please enter a valid image file."); + if (!isImage(input)) + throw new OperationError("Please enter a valid image file."); const [colour, bit] = args, parsedImage = await Jimp.read(input), width = parsedImage.bitmap.width, height = parsedImage.bitmap.height, colourIndex = COLOUR_OPTIONS.indexOf(colour), - bitIndex = 7-bit; + bitIndex = 7 - bit; if (bit < 0 || bit > 7) { - throw new OperationError("Error: Bit argument must be between 0 and 7"); + throw new OperationError( + "Error: Bit argument must be between 0 and 7", + ); } let pixel, bin, newPixelValue; - parsedImage.scan(0, 0, width, height, function(x, y, idx) { + parsedImage.scan(0, 0, width, height, function (x, y, idx) { pixel = this.bitmap.data[idx + colourIndex]; bin = Utils.bin(pixel); newPixelValue = 255; if (bin.charAt(bitIndex) === "1") newPixelValue = 0; - for (let i=0; i < 3; i++) { + for (let i = 0; i < 3; i++) { this.bitmap.data[idx + i] = newPixelValue; } this.bitmap.data[idx + 3] = 255; - }); - const imageBuffer = await parsedImage.getBufferAsync(Jimp.AUTO); + const imageBuffer = await parsedImage.getBuffer(parsedImage.mime); return new Uint8Array(imageBuffer).buffer; } @@ -94,14 +96,8 @@ class ViewBitPlane extends Operation { return ``; } - } -const COLOUR_OPTIONS = [ - "Red", - "Green", - "Blue", - "Alpha" -]; +const COLOUR_OPTIONS = ["Red", "Green", "Blue", "Alpha"]; export default ViewBitPlane; diff --git a/src/node/api.mjs b/src/node/api.mjs index 88b3f834..82b5f61e 100644 --- a/src/node/api.mjs +++ b/src/node/api.mjs @@ -10,7 +10,7 @@ import NodeDish from "./NodeDish.mjs"; import NodeRecipe from "./NodeRecipe.mjs"; -import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"}; +import OperationConfig from "../core/config/OperationConfig.json" with { type: "json" }; import { sanitise, removeSubheadingsFromArray, sentenceToCamelCase } from "./apiUtils.mjs"; import ExcludedOperationError from "../core/errors/ExcludedOperationError.mjs"; diff --git a/src/node/apiUtils.mjs b/src/node/apiUtils.mjs index 64688073..9d1c43cc 100644 --- a/src/node/apiUtils.mjs +++ b/src/node/apiUtils.mjs @@ -66,7 +66,7 @@ export function removeSubheadingsFromArray(array) { * @param str */ export function sanitise(str) { - return str.replace(/ /g, "").toLowerCase(); + return str.replace(/[/\s.-]/g, "").toLowerCase(); } diff --git a/src/node/config/scripts/generateNodeIndex.mjs b/src/node/config/scripts/generateNodeIndex.mjs index 981c9b79..f586a475 100644 --- a/src/node/config/scripts/generateNodeIndex.mjs +++ b/src/node/config/scripts/generateNodeIndex.mjs @@ -23,7 +23,7 @@ const dir = path.join(`${process.cwd()}/src/node`); if (!fs.existsSync(dir)) { console.log("\nCWD: " + process.cwd()); console.log("Error: generateNodeIndex.mjs should be run from the project root"); - console.log("Example> node --experimental-modules src/node/config/scripts/generateNodeIndex.mjs"); + console.log("Example> node src/node/config/scripts/generateNodeIndex.mjs"); process.exit(1); } diff --git a/src/web/App.mjs b/src/web/App.mjs index 7071854a..143545d6 100644 --- a/src/web/App.mjs +++ b/src/web/App.mjs @@ -650,7 +650,7 @@ class App { // const compareURL = `https://github.com/gchq/CyberChef/compare/v${prev.join(".")}...v${PKG_VERSION}`; - let compileInfo = `Last build: ${timeSinceCompile.substr(0, 1).toUpperCase() + timeSinceCompile.substr(1)} ago`; + let compileInfo = `Last build: ${timeSinceCompile.substring(0, 1).toUpperCase() + timeSinceCompile.substring(1)} ago`; if (window.compileMessage !== "") { compileInfo += " - " + window.compileMessage; diff --git a/src/web/index.js b/src/web/index.js index 90142b34..110f0d2b 100755 --- a/src/web/index.js +++ b/src/web/index.js @@ -17,8 +17,8 @@ import * as CanvasComponents from "../core/lib/CanvasComponents.mjs"; // CyberChef import App from "./App.mjs"; -import Categories from "../core/config/Categories.json" assert {type: "json"}; -import OperationConfig from "../core/config/OperationConfig.json" assert {type: "json"}; +import Categories from "../core/config/Categories.json" with { type: "json" }; +import OperationConfig from "../core/config/OperationConfig.json" with { type: "json" }; /** diff --git a/src/web/static/fonts/bmfonts/Roboto72White.fnt b/src/web/static/fonts/bmfonts/Roboto72White.fnt index 57238158..19cb2ab8 100644 --- a/src/web/static/fonts/bmfonts/Roboto72White.fnt +++ b/src/web/static/fonts/bmfonts/Roboto72White.fnt @@ -1,485 +1,491 @@ -info face="Roboto" size=72 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2 -common lineHeight=85 base=67 scaleW=512 scaleH=512 pages=1 packed=0 -page id=0 file="Roboto72White.png" -chars count=98 -char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=66 xadvance=0 page=0 chnl=0 -char id=10 x=0 y=0 width=70 height=99 xoffset=2 yoffset=-11 xadvance=74 page=0 chnl=0 -char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=66 xadvance=18 page=0 chnl=0 -char id=33 x=493 y=99 width=10 height=55 xoffset=5 yoffset=14 xadvance=19 page=0 chnl=0 -char id=34 x=446 y=319 width=16 height=19 xoffset=4 yoffset=12 xadvance=23 page=0 chnl=0 -char id=35 x=204 y=265 width=41 height=54 xoffset=3 yoffset=14 xadvance=44 page=0 chnl=0 -char id=36 x=269 y=0 width=35 height=69 xoffset=3 yoffset=6 xadvance=40 page=0 chnl=0 -char id=37 x=31 y=155 width=48 height=56 xoffset=3 yoffset=13 xadvance=53 page=0 chnl=0 -char id=38 x=79 y=155 width=43 height=56 xoffset=3 yoffset=13 xadvance=45 page=0 chnl=0 -char id=39 x=503 y=99 width=7 height=19 xoffset=3 yoffset=12 xadvance=13 page=0 chnl=0 -char id=40 x=70 y=0 width=21 height=78 xoffset=4 yoffset=7 xadvance=25 page=0 chnl=0 -char id=41 x=91 y=0 width=22 height=78 xoffset=-1 yoffset=7 xadvance=25 page=0 chnl=0 -char id=42 x=342 y=319 width=32 height=32 xoffset=-1 yoffset=14 xadvance=31 page=0 chnl=0 -char id=43 x=242 y=319 width=37 height=40 xoffset=2 yoffset=23 xadvance=41 page=0 chnl=0 -char id=44 x=433 y=319 width=13 height=21 xoffset=-1 yoffset=58 xadvance=14 page=0 chnl=0 -char id=45 x=27 y=360 width=19 height=8 xoffset=0 yoffset=41 xadvance=19 page=0 chnl=0 -char id=46 x=17 y=360 width=10 height=11 xoffset=4 yoffset=58 xadvance=19 page=0 chnl=0 -char id=47 x=355 y=0 width=30 height=58 xoffset=-1 yoffset=14 xadvance=30 page=0 chnl=0 -char id=48 x=449 y=99 width=34 height=56 xoffset=3 yoffset=13 xadvance=40 page=0 chnl=0 -char id=49 x=474 y=211 width=22 height=54 xoffset=5 yoffset=14 xadvance=40 page=0 chnl=0 -char id=50 x=195 y=155 width=37 height=55 xoffset=2 yoffset=13 xadvance=41 page=0 chnl=0 -char id=51 x=379 y=99 width=35 height=56 xoffset=2 yoffset=13 xadvance=40 page=0 chnl=0 -char id=52 x=128 y=265 width=39 height=54 xoffset=1 yoffset=14 xadvance=41 page=0 chnl=0 -char id=53 x=232 y=155 width=35 height=55 xoffset=4 yoffset=14 xadvance=40 page=0 chnl=0 -char id=54 x=267 y=155 width=35 height=55 xoffset=4 yoffset=14 xadvance=41 page=0 chnl=0 -char id=55 x=167 y=265 width=37 height=54 xoffset=2 yoffset=14 xadvance=41 page=0 chnl=0 -char id=56 x=414 y=99 width=35 height=56 xoffset=3 yoffset=13 xadvance=40 page=0 chnl=0 -char id=57 x=302 y=155 width=34 height=55 xoffset=3 yoffset=13 xadvance=41 page=0 chnl=0 -char id=58 x=495 y=265 width=10 height=41 xoffset=4 yoffset=28 xadvance=18 page=0 chnl=0 -char id=59 x=496 y=211 width=13 height=52 xoffset=0 yoffset=28 xadvance=15 page=0 chnl=0 -char id=60 x=279 y=319 width=31 height=35 xoffset=2 yoffset=27 xadvance=37 page=0 chnl=0 -char id=61 x=402 y=319 width=31 height=23 xoffset=4 yoffset=31 xadvance=39 page=0 chnl=0 -char id=62 x=310 y=319 width=32 height=35 xoffset=4 yoffset=27 xadvance=38 page=0 chnl=0 -char id=63 x=0 y=155 width=31 height=56 xoffset=2 yoffset=13 xadvance=34 page=0 chnl=0 -char id=64 x=210 y=0 width=59 height=69 xoffset=3 yoffset=15 xadvance=65 page=0 chnl=0 -char id=65 x=336 y=155 width=49 height=54 xoffset=-1 yoffset=14 xadvance=47 page=0 chnl=0 -char id=66 x=385 y=155 width=37 height=54 xoffset=5 yoffset=14 xadvance=45 page=0 chnl=0 -char id=67 x=0 y=99 width=42 height=56 xoffset=3 yoffset=13 xadvance=46 page=0 chnl=0 -char id=68 x=422 y=155 width=39 height=54 xoffset=5 yoffset=14 xadvance=47 page=0 chnl=0 -char id=69 x=461 y=155 width=35 height=54 xoffset=5 yoffset=14 xadvance=41 page=0 chnl=0 -char id=70 x=0 y=211 width=34 height=54 xoffset=5 yoffset=14 xadvance=40 page=0 chnl=0 -char id=71 x=42 y=99 width=42 height=56 xoffset=3 yoffset=13 xadvance=49 page=0 chnl=0 -char id=72 x=34 y=211 width=41 height=54 xoffset=5 yoffset=14 xadvance=51 page=0 chnl=0 -char id=73 x=496 y=155 width=9 height=54 xoffset=5 yoffset=14 xadvance=19 page=0 chnl=0 -char id=74 x=122 y=155 width=34 height=55 xoffset=1 yoffset=14 xadvance=40 page=0 chnl=0 -char id=75 x=75 y=211 width=41 height=54 xoffset=5 yoffset=14 xadvance=45 page=0 chnl=0 -char id=76 x=116 y=211 width=33 height=54 xoffset=5 yoffset=14 xadvance=39 page=0 chnl=0 -char id=77 x=149 y=211 width=53 height=54 xoffset=5 yoffset=14 xadvance=63 page=0 chnl=0 -char id=78 x=202 y=211 width=41 height=54 xoffset=5 yoffset=14 xadvance=51 page=0 chnl=0 -char id=79 x=84 y=99 width=43 height=56 xoffset=3 yoffset=13 xadvance=49 page=0 chnl=0 -char id=80 x=243 y=211 width=39 height=54 xoffset=5 yoffset=14 xadvance=45 page=0 chnl=0 -char id=81 x=304 y=0 width=44 height=64 xoffset=3 yoffset=13 xadvance=49 page=0 chnl=0 -char id=82 x=282 y=211 width=40 height=54 xoffset=5 yoffset=14 xadvance=45 page=0 chnl=0 -char id=83 x=127 y=99 width=39 height=56 xoffset=2 yoffset=13 xadvance=43 page=0 chnl=0 -char id=84 x=322 y=211 width=42 height=54 xoffset=1 yoffset=14 xadvance=44 page=0 chnl=0 -char id=85 x=156 y=155 width=39 height=55 xoffset=4 yoffset=14 xadvance=47 page=0 chnl=0 -char id=86 x=364 y=211 width=47 height=54 xoffset=-1 yoffset=14 xadvance=46 page=0 chnl=0 -char id=87 x=411 y=211 width=63 height=54 xoffset=1 yoffset=14 xadvance=64 page=0 chnl=0 -char id=88 x=0 y=265 width=44 height=54 xoffset=1 yoffset=14 xadvance=45 page=0 chnl=0 -char id=89 x=44 y=265 width=45 height=54 xoffset=-1 yoffset=14 xadvance=43 page=0 chnl=0 -char id=90 x=89 y=265 width=39 height=54 xoffset=2 yoffset=14 xadvance=43 page=0 chnl=0 -char id=91 x=161 y=0 width=16 height=72 xoffset=4 yoffset=7 xadvance=19 page=0 chnl=0 -char id=92 x=385 y=0 width=30 height=58 xoffset=0 yoffset=14 xadvance=30 page=0 chnl=0 -char id=93 x=177 y=0 width=16 height=72 xoffset=0 yoffset=7 xadvance=20 page=0 chnl=0 -char id=94 x=374 y=319 width=28 height=28 xoffset=1 yoffset=14 xadvance=30 page=0 chnl=0 -char id=95 x=46 y=360 width=34 height=8 xoffset=0 yoffset=65 xadvance=34 page=0 chnl=0 -char id=96 x=0 y=360 width=17 height=13 xoffset=1 yoffset=11 xadvance=22 page=0 chnl=0 -char id=97 x=268 y=265 width=34 height=42 xoffset=3 yoffset=27 xadvance=39 page=0 chnl=0 -char id=98 x=415 y=0 width=34 height=57 xoffset=4 yoffset=12 xadvance=40 page=0 chnl=0 -char id=99 x=302 y=265 width=34 height=42 xoffset=2 yoffset=27 xadvance=38 page=0 chnl=0 -char id=100 x=449 y=0 width=34 height=57 xoffset=2 yoffset=12 xadvance=40 page=0 chnl=0 -char id=101 x=336 y=265 width=34 height=42 xoffset=2 yoffset=27 xadvance=38 page=0 chnl=0 -char id=102 x=483 y=0 width=25 height=57 xoffset=1 yoffset=11 xadvance=26 page=0 chnl=0 -char id=103 x=166 y=99 width=34 height=56 xoffset=2 yoffset=27 xadvance=40 page=0 chnl=0 -char id=104 x=200 y=99 width=32 height=56 xoffset=4 yoffset=12 xadvance=40 page=0 chnl=0 -char id=105 x=483 y=99 width=10 height=55 xoffset=4 yoffset=13 xadvance=18 page=0 chnl=0 -char id=106 x=193 y=0 width=17 height=71 xoffset=-4 yoffset=13 xadvance=17 page=0 chnl=0 -char id=107 x=232 y=99 width=34 height=56 xoffset=4 yoffset=12 xadvance=37 page=0 chnl=0 -char id=108 x=266 y=99 width=9 height=56 xoffset=4 yoffset=12 xadvance=17 page=0 chnl=0 -char id=109 x=439 y=265 width=56 height=41 xoffset=4 yoffset=27 xadvance=64 page=0 chnl=0 -char id=110 x=0 y=319 width=32 height=41 xoffset=4 yoffset=27 xadvance=40 page=0 chnl=0 -char id=111 x=370 y=265 width=37 height=42 xoffset=2 yoffset=27 xadvance=41 page=0 chnl=0 -char id=112 x=275 y=99 width=34 height=56 xoffset=4 yoffset=27 xadvance=40 page=0 chnl=0 -char id=113 x=309 y=99 width=34 height=56 xoffset=2 yoffset=27 xadvance=41 page=0 chnl=0 -char id=114 x=32 y=319 width=21 height=41 xoffset=4 yoffset=27 xadvance=25 page=0 chnl=0 -char id=115 x=407 y=265 width=32 height=42 xoffset=2 yoffset=27 xadvance=37 page=0 chnl=0 -char id=116 x=245 y=265 width=23 height=51 xoffset=0 yoffset=18 xadvance=25 page=0 chnl=0 -char id=117 x=53 y=319 width=32 height=41 xoffset=4 yoffset=28 xadvance=40 page=0 chnl=0 -char id=118 x=85 y=319 width=35 height=40 xoffset=0 yoffset=28 xadvance=35 page=0 chnl=0 -char id=119 x=120 y=319 width=54 height=40 xoffset=0 yoffset=28 xadvance=54 page=0 chnl=0 -char id=120 x=174 y=319 width=36 height=40 xoffset=0 yoffset=28 xadvance=36 page=0 chnl=0 -char id=121 x=343 y=99 width=36 height=56 xoffset=-1 yoffset=28 xadvance=34 page=0 chnl=0 -char id=122 x=210 y=319 width=32 height=40 xoffset=2 yoffset=28 xadvance=35 page=0 chnl=0 -char id=123 x=113 y=0 width=24 height=73 xoffset=1 yoffset=9 xadvance=25 page=0 chnl=0 -char id=124 x=348 y=0 width=7 height=63 xoffset=5 yoffset=14 xadvance=17 page=0 chnl=0 -char id=125 x=137 y=0 width=24 height=73 xoffset=-1 yoffset=9 xadvance=24 page=0 chnl=0 -char id=126 x=462 y=319 width=42 height=16 xoffset=4 yoffset=38 xadvance=50 page=0 chnl=0 -char id=127 x=0 y=0 width=70 height=99 xoffset=2 yoffset=-11 xadvance=74 page=0 chnl=0 -kernings count=382 -kerning first=70 second=74 amount=-9 -kerning first=34 second=97 amount=-2 -kerning first=34 second=101 amount=-2 -kerning first=34 second=113 amount=-2 -kerning first=34 second=99 amount=-2 -kerning first=70 second=99 amount=-1 -kerning first=88 second=113 amount=-1 -kerning first=84 second=46 amount=-8 -kerning first=84 second=119 amount=-2 -kerning first=87 second=97 amount=-1 -kerning first=90 second=117 amount=-1 -kerning first=39 second=97 amount=-2 -kerning first=69 second=111 amount=-1 -kerning first=87 second=41 amount=1 -kerning first=76 second=86 amount=-6 -kerning first=121 second=34 amount=1 -kerning first=40 second=86 amount=1 -kerning first=85 second=65 amount=-1 -kerning first=89 second=89 amount=1 -kerning first=72 second=65 amount=1 -kerning first=104 second=39 amount=-4 -kerning first=114 second=102 amount=1 -kerning first=89 second=42 amount=-2 -kerning first=114 second=34 amount=1 -kerning first=84 second=115 amount=-4 -kerning first=84 second=71 amount=-1 -kerning first=89 second=101 amount=-2 -kerning first=89 second=45 amount=-2 -kerning first=122 second=99 amount=-1 -kerning first=78 second=88 amount=1 -kerning first=68 second=89 amount=-2 -kerning first=122 second=103 amount=-1 -kerning first=78 second=84 amount=-1 -kerning first=86 second=103 amount=-2 -kerning first=89 second=67 amount=-1 -kerning first=89 second=79 amount=-1 -kerning first=75 second=111 amount=-1 -kerning first=111 second=120 amount=-1 -kerning first=87 second=44 amount=-4 -kerning first=91 second=74 amount=-1 -kerning first=120 second=111 amount=-1 -kerning first=84 second=111 amount=-3 -kerning first=102 second=113 amount=-1 -kerning first=80 second=88 amount=-1 -kerning first=66 second=84 amount=-1 -kerning first=65 second=87 amount=-2 -kerning first=86 second=100 amount=-2 -kerning first=122 second=100 amount=-1 -kerning first=75 second=118 amount=-1 -kerning first=70 second=118 amount=-1 -kerning first=73 second=88 amount=1 -kerning first=70 second=121 amount=-1 -kerning first=65 second=34 amount=-4 -kerning first=39 second=101 amount=-2 -kerning first=75 second=101 amount=-1 -kerning first=84 second=99 amount=-3 -kerning first=84 second=65 amount=-3 -kerning first=112 second=39 amount=-1 -kerning first=76 second=39 amount=-12 -kerning first=78 second=65 amount=1 -kerning first=88 second=45 amount=-2 -kerning first=65 second=121 amount=-2 -kerning first=34 second=111 amount=-2 -kerning first=89 second=85 amount=-3 -kerning first=114 second=99 amount=-1 -kerning first=86 second=125 amount=1 -kerning first=70 second=111 amount=-1 -kerning first=89 second=120 amount=-1 -kerning first=90 second=119 amount=-1 -kerning first=120 second=99 amount=-1 -kerning first=89 second=117 amount=-1 -kerning first=82 second=89 amount=-2 -kerning first=75 second=117 amount=-1 -kerning first=34 second=34 amount=-4 -kerning first=89 second=110 amount=-1 -kerning first=88 second=101 amount=-1 -kerning first=107 second=103 amount=-1 -kerning first=34 second=115 amount=-3 -kerning first=98 second=39 amount=-1 -kerning first=70 second=65 amount=-6 -kerning first=70 second=46 amount=-8 -kerning first=98 second=34 amount=-1 -kerning first=70 second=84 amount=1 -kerning first=114 second=100 amount=-1 -kerning first=88 second=79 amount=-1 -kerning first=39 second=113 amount=-2 -kerning first=114 second=103 amount=-1 -kerning first=77 second=65 amount=1 -kerning first=120 second=103 amount=-1 -kerning first=114 second=121 amount=1 -kerning first=89 second=100 amount=-2 -kerning first=80 second=65 amount=-5 -kerning first=121 second=111 amount=-1 -kerning first=84 second=74 amount=-8 -kerning first=122 second=111 amount=-1 -kerning first=114 second=118 amount=1 -kerning first=102 second=41 amount=1 -kerning first=122 second=113 amount=-1 -kerning first=89 second=122 amount=-1 -kerning first=89 second=38 amount=-1 -kerning first=81 second=89 amount=-1 -kerning first=114 second=111 amount=-1 -kerning first=46 second=34 amount=-6 -kerning first=84 second=112 amount=-4 -kerning first=112 second=34 amount=-1 -kerning first=76 second=34 amount=-12 -kerning first=102 second=125 amount=1 -kerning first=39 second=115 amount=-3 -kerning first=76 second=118 amount=-5 -kerning first=86 second=99 amount=-2 -kerning first=84 second=84 amount=1 -kerning first=86 second=65 amount=-3 -kerning first=87 second=101 amount=-1 -kerning first=67 second=125 amount=-1 -kerning first=120 second=113 amount=-1 -kerning first=118 second=46 amount=-4 -kerning first=88 second=103 amount=-1 -kerning first=111 second=122 amount=-1 -kerning first=77 second=84 amount=-1 -kerning first=114 second=46 amount=-4 -kerning first=34 second=39 amount=-4 -kerning first=114 second=44 amount=-4 -kerning first=69 second=84 amount=1 -kerning first=89 second=46 amount=-7 -kerning first=97 second=39 amount=-2 -kerning first=34 second=100 amount=-2 -kerning first=70 second=100 amount=-1 -kerning first=84 second=120 amount=-3 -kerning first=90 second=118 amount=-1 -kerning first=70 second=114 amount=-1 -kerning first=34 second=112 amount=-1 -kerning first=109 second=34 amount=-4 -kerning first=86 second=113 amount=-2 -kerning first=88 second=71 amount=-1 -kerning first=66 second=89 amount=-2 -kerning first=102 second=103 amount=-1 -kerning first=88 second=67 amount=-1 -kerning first=39 second=110 amount=-1 -kerning first=75 second=110 amount=-1 -kerning first=88 second=117 amount=-1 -kerning first=89 second=118 amount=-1 -kerning first=97 second=118 amount=-1 -kerning first=87 second=65 amount=-2 -kerning first=73 second=89 amount=-1 -kerning first=89 second=74 amount=-3 -kerning first=102 second=101 amount=-1 -kerning first=86 second=111 amount=-2 -kerning first=65 second=119 amount=-1 -kerning first=84 second=100 amount=-3 -kerning first=104 second=34 amount=-4 -kerning first=86 second=41 amount=1 -kerning first=111 second=34 amount=-5 -kerning first=40 second=89 amount=1 -kerning first=121 second=39 amount=1 -kerning first=68 second=90 amount=-1 -kerning first=114 second=113 amount=-1 -kerning first=68 second=88 amount=-1 -kerning first=98 second=120 amount=-1 -kerning first=110 second=34 amount=-4 -kerning first=119 second=44 amount=-4 -kerning first=119 second=46 amount=-4 -kerning first=118 second=44 amount=-4 -kerning first=84 second=114 amount=-3 -kerning first=86 second=97 amount=-2 -kerning first=68 second=86 amount=-1 -kerning first=86 second=93 amount=1 -kerning first=97 second=34 amount=-2 -kerning first=34 second=65 amount=-4 -kerning first=84 second=118 amount=-3 -kerning first=76 second=84 amount=-10 -kerning first=107 second=99 amount=-1 -kerning first=121 second=46 amount=-4 -kerning first=123 second=85 amount=-1 -kerning first=65 second=63 amount=-2 -kerning first=89 second=44 amount=-7 -kerning first=80 second=118 amount=1 -kerning first=112 second=122 amount=-1 -kerning first=79 second=65 amount=-1 -kerning first=80 second=121 amount=1 -kerning first=118 second=34 amount=1 -kerning first=87 second=45 amount=-2 -kerning first=69 second=100 amount=-1 -kerning first=87 second=103 amount=-1 -kerning first=112 second=120 amount=-1 -kerning first=68 second=44 amount=-4 -kerning first=86 second=45 amount=-1 -kerning first=39 second=34 amount=-4 -kerning first=68 second=46 amount=-4 -kerning first=65 second=89 amount=-3 -kerning first=69 second=118 amount=-1 -kerning first=88 second=99 amount=-1 -kerning first=87 second=46 amount=-4 -kerning first=47 second=47 amount=-8 -kerning first=73 second=65 amount=1 -kerning first=123 second=74 amount=-1 -kerning first=69 second=102 amount=-1 -kerning first=87 second=111 amount=-1 -kerning first=39 second=112 amount=-1 -kerning first=89 second=116 amount=-1 -kerning first=70 second=113 amount=-1 -kerning first=77 second=88 amount=1 -kerning first=84 second=32 amount=-1 -kerning first=90 second=103 amount=-1 -kerning first=65 second=86 amount=-3 -kerning first=75 second=112 amount=-1 -kerning first=39 second=109 amount=-1 -kerning first=75 second=81 amount=-1 -kerning first=89 second=115 amount=-2 -kerning first=84 second=83 amount=-1 -kerning first=89 second=87 amount=1 -kerning first=114 second=101 amount=-1 -kerning first=116 second=111 amount=-1 -kerning first=90 second=100 amount=-1 -kerning first=84 second=122 amount=-2 -kerning first=68 second=84 amount=-1 -kerning first=32 second=84 amount=-1 -kerning first=84 second=117 amount=-3 -kerning first=74 second=65 amount=-1 -kerning first=107 second=101 amount=-1 -kerning first=75 second=109 amount=-1 -kerning first=80 second=46 amount=-11 -kerning first=89 second=93 amount=1 -kerning first=89 second=65 amount=-3 -kerning first=87 second=117 amount=-1 -kerning first=89 second=81 amount=-1 -kerning first=39 second=103 amount=-2 -kerning first=86 second=101 amount=-2 -kerning first=86 second=117 amount=-1 -kerning first=84 second=113 amount=-3 -kerning first=34 second=110 amount=-1 -kerning first=89 second=84 amount=1 -kerning first=84 second=110 amount=-4 -kerning first=39 second=99 amount=-2 -kerning first=88 second=121 amount=-1 -kerning first=65 second=39 amount=-4 -kerning first=110 second=39 amount=-4 -kerning first=75 second=67 amount=-1 -kerning first=88 second=118 amount=-1 -kerning first=86 second=114 amount=-1 -kerning first=80 second=74 amount=-7 -kerning first=84 second=97 amount=-4 -kerning first=82 second=84 amount=-3 -kerning first=91 second=85 amount=-1 -kerning first=102 second=99 amount=-1 -kerning first=66 second=86 amount=-1 -kerning first=120 second=101 amount=-1 -kerning first=102 second=93 amount=1 -kerning first=75 second=100 amount=-1 -kerning first=84 second=79 amount=-1 -kerning first=111 second=121 amount=-1 -kerning first=75 second=121 amount=-1 -kerning first=81 second=87 amount=-1 -kerning first=107 second=113 amount=-1 -kerning first=120 second=100 amount=-1 -kerning first=90 second=79 amount=-1 -kerning first=89 second=114 amount=-1 -kerning first=122 second=101 amount=-1 -kerning first=111 second=118 amount=-1 -kerning first=82 second=86 amount=-1 -kerning first=67 second=84 amount=-1 -kerning first=70 second=101 amount=-1 -kerning first=89 second=83 amount=-1 -kerning first=114 second=97 amount=-1 -kerning first=70 second=97 amount=-1 -kerning first=89 second=102 amount=-1 -kerning first=78 second=89 amount=-1 -kerning first=70 second=44 amount=-8 -kerning first=44 second=39 amount=-6 -kerning first=84 second=45 amount=-8 -kerning first=89 second=121 amount=-1 -kerning first=84 second=86 amount=1 -kerning first=87 second=99 amount=-1 -kerning first=98 second=122 amount=-1 -kerning first=89 second=112 amount=-1 -kerning first=89 second=103 amount=-2 -kerning first=88 second=81 amount=-1 -kerning first=102 second=34 amount=1 -kerning first=109 second=39 amount=-4 -kerning first=81 second=84 amount=-2 -kerning first=121 second=97 amount=-1 -kerning first=89 second=99 amount=-2 -kerning first=89 second=125 amount=1 -kerning first=81 second=86 amount=-1 -kerning first=114 second=116 amount=2 -kerning first=114 second=119 amount=1 -kerning first=84 second=44 amount=-8 -kerning first=102 second=39 amount=1 -kerning first=44 second=34 amount=-6 -kerning first=34 second=109 amount=-1 -kerning first=75 second=119 amount=-2 -kerning first=76 second=65 amount=1 -kerning first=84 second=81 amount=-1 -kerning first=76 second=121 amount=-5 -kerning first=69 second=101 amount=-1 -kerning first=89 second=111 amount=-2 -kerning first=80 second=90 amount=-1 -kerning first=89 second=97 amount=-3 -kerning first=89 second=109 amount=-1 -kerning first=90 second=99 amount=-1 -kerning first=89 second=86 amount=1 -kerning first=79 second=88 amount=-1 -kerning first=70 second=103 amount=-1 -kerning first=34 second=103 amount=-2 -kerning first=84 second=67 amount=-1 -kerning first=76 second=79 amount=-2 -kerning first=89 second=41 amount=1 -kerning first=65 second=118 amount=-2 -kerning first=75 second=71 amount=-1 -kerning first=76 second=87 amount=-5 -kerning first=77 second=89 amount=-1 -kerning first=90 second=113 amount=-1 -kerning first=79 second=89 amount=-2 -kerning first=118 second=111 amount=-1 -kerning first=118 second=97 amount=-1 -kerning first=88 second=100 amount=-1 -kerning first=90 second=121 amount=-1 -kerning first=89 second=113 amount=-2 -kerning first=84 second=87 amount=1 -kerning first=39 second=111 amount=-2 -kerning first=80 second=44 amount=-11 -kerning first=39 second=100 amount=-2 -kerning first=75 second=113 amount=-1 -kerning first=88 second=111 amount=-1 -kerning first=84 second=89 amount=1 -kerning first=84 second=103 amount=-3 -kerning first=70 second=117 amount=-1 -kerning first=67 second=41 amount=-1 -kerning first=89 second=71 amount=-1 -kerning first=121 second=44 amount=-4 -kerning first=97 second=121 amount=-1 -kerning first=87 second=113 amount=-1 -kerning first=73 second=84 amount=-1 -kerning first=84 second=101 amount=-3 -kerning first=75 second=99 amount=-1 -kerning first=65 second=85 amount=-1 -kerning first=76 second=67 amount=-2 -kerning first=76 second=81 amount=-2 -kerning first=75 second=79 amount=-1 -kerning first=39 second=65 amount=-4 -kerning first=76 second=117 amount=-2 -kerning first=65 second=84 amount=-5 -kerning first=90 second=101 amount=-1 -kerning first=84 second=121 amount=-3 -kerning first=69 second=99 amount=-1 -kerning first=114 second=39 amount=1 -kerning first=84 second=109 amount=-4 -kerning first=76 second=119 amount=-3 -kerning first=76 second=85 amount=-2 -kerning first=65 second=116 amount=-1 -kerning first=76 second=71 amount=-2 -kerning first=79 second=90 amount=-1 -kerning first=107 second=100 amount=-1 -kerning first=90 second=111 amount=-1 -kerning first=79 second=44 amount=-4 -kerning first=75 second=45 amount=-2 -kerning first=40 second=87 amount=1 -kerning first=79 second=86 amount=-1 -kerning first=102 second=100 amount=-1 -kerning first=72 second=89 amount=-1 -kerning first=72 second=88 amount=1 -kerning first=79 second=46 amount=-4 -kerning first=76 second=89 amount=-8 -kerning first=68 second=65 amount=-1 -kerning first=79 second=84 amount=-1 -kerning first=87 second=100 amount=-1 -kerning first=75 second=103 amount=-1 -kerning first=90 second=67 amount=-1 -kerning first=69 second=103 amount=-1 -kerning first=90 second=71 amount=-1 -kerning first=86 second=44 amount=-8 -kerning first=69 second=121 amount=-1 -kerning first=87 second=114 amount=-1 -kerning first=118 second=39 amount=1 -kerning first=46 second=39 amount=-6 -kerning first=72 second=84 amount=-1 -kerning first=86 second=46 amount=-8 -kerning first=69 second=113 amount=-1 -kerning first=69 second=119 amount=-1 -kerning first=39 second=39 amount=-4 -kerning first=69 second=117 amount=-1 -kerning first=111 second=39 amount=-5 -kerning first=90 second=81 amount=-1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/web/static/fonts/bmfonts/RobotoBlack72White.fnt b/src/web/static/fonts/bmfonts/RobotoBlack72White.fnt index d82c9c7b..77f0ed89 100644 --- a/src/web/static/fonts/bmfonts/RobotoBlack72White.fnt +++ b/src/web/static/fonts/bmfonts/RobotoBlack72White.fnt @@ -1,488 +1,494 @@ -info face="Roboto Black" size=72 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2 -common lineHeight=85 base=67 scaleW=512 scaleH=512 pages=1 packed=0 -page id=0 file="RobotoBlack72White.png" -chars count=98 -char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=66 xadvance=0 page=0 chnl=0 -char id=10 x=0 y=0 width=70 height=99 xoffset=2 yoffset=-11 xadvance=74 page=0 chnl=0 -char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=66 xadvance=18 page=0 chnl=0 -char id=33 x=460 y=156 width=15 height=55 xoffset=3 yoffset=14 xadvance=20 page=0 chnl=0 -char id=34 x=207 y=362 width=22 height=22 xoffset=0 yoffset=12 xadvance=23 page=0 chnl=0 -char id=35 x=404 y=266 width=41 height=54 xoffset=0 yoffset=14 xadvance=42 page=0 chnl=0 -char id=36 x=220 y=0 width=38 height=69 xoffset=2 yoffset=7 xadvance=42 page=0 chnl=0 -char id=37 x=167 y=156 width=49 height=56 xoffset=2 yoffset=13 xadvance=53 page=0 chnl=0 -char id=38 x=216 y=156 width=48 height=56 xoffset=1 yoffset=13 xadvance=48 page=0 chnl=0 -char id=39 x=499 y=320 width=10 height=22 xoffset=1 yoffset=12 xadvance=11 page=0 chnl=0 -char id=40 x=70 y=0 width=22 height=75 xoffset=3 yoffset=9 xadvance=25 page=0 chnl=0 -char id=41 x=92 y=0 width=23 height=75 xoffset=0 yoffset=9 xadvance=25 page=0 chnl=0 -char id=42 x=103 y=362 width=36 height=34 xoffset=-1 yoffset=14 xadvance=33 page=0 chnl=0 -char id=43 x=0 y=362 width=37 height=40 xoffset=1 yoffset=23 xadvance=39 page=0 chnl=0 -char id=44 x=483 y=320 width=16 height=25 xoffset=0 yoffset=57 xadvance=20 page=0 chnl=0 -char id=45 x=308 y=362 width=23 height=12 xoffset=4 yoffset=38 xadvance=32 page=0 chnl=0 -char id=46 x=270 y=362 width=15 height=15 xoffset=3 yoffset=54 xadvance=22 page=0 chnl=0 -char id=47 x=374 y=0 width=29 height=58 xoffset=-3 yoffset=14 xadvance=25 page=0 chnl=0 -char id=48 x=77 y=156 width=38 height=56 xoffset=2 yoffset=13 xadvance=42 page=0 chnl=0 -char id=49 x=299 y=266 width=26 height=54 xoffset=4 yoffset=14 xadvance=41 page=0 chnl=0 -char id=50 x=383 y=156 width=39 height=55 xoffset=1 yoffset=13 xadvance=42 page=0 chnl=0 -char id=51 x=434 y=99 width=39 height=56 xoffset=1 yoffset=13 xadvance=42 page=0 chnl=0 -char id=52 x=325 y=266 width=40 height=54 xoffset=1 yoffset=14 xadvance=42 page=0 chnl=0 -char id=53 x=422 y=156 width=38 height=55 xoffset=2 yoffset=14 xadvance=42 page=0 chnl=0 -char id=54 x=0 y=156 width=39 height=56 xoffset=2 yoffset=13 xadvance=42 page=0 chnl=0 -char id=55 x=365 y=266 width=39 height=54 xoffset=1 yoffset=14 xadvance=42 page=0 chnl=0 -char id=56 x=473 y=99 width=38 height=56 xoffset=2 yoffset=13 xadvance=42 page=0 chnl=0 -char id=57 x=39 y=156 width=38 height=56 xoffset=2 yoffset=13 xadvance=42 page=0 chnl=0 -char id=58 x=471 y=266 width=15 height=43 xoffset=3 yoffset=26 xadvance=21 page=0 chnl=0 -char id=59 x=150 y=156 width=17 height=56 xoffset=1 yoffset=26 xadvance=21 page=0 chnl=0 -char id=60 x=37 y=362 width=33 height=38 xoffset=1 yoffset=26 xadvance=37 page=0 chnl=0 -char id=61 x=172 y=362 width=35 height=27 xoffset=3 yoffset=31 xadvance=42 page=0 chnl=0 -char id=62 x=70 y=362 width=33 height=38 xoffset=3 yoffset=26 xadvance=37 page=0 chnl=0 -char id=63 x=115 y=156 width=35 height=56 xoffset=0 yoffset=13 xadvance=36 page=0 chnl=0 -char id=64 x=258 y=0 width=61 height=68 xoffset=1 yoffset=16 xadvance=64 page=0 chnl=0 -char id=65 x=0 y=212 width=53 height=54 xoffset=-2 yoffset=14 xadvance=49 page=0 chnl=0 -char id=66 x=53 y=212 width=42 height=54 xoffset=3 yoffset=14 xadvance=47 page=0 chnl=0 -char id=67 x=37 y=99 width=46 height=56 xoffset=1 yoffset=13 xadvance=47 page=0 chnl=0 -char id=68 x=95 y=212 width=42 height=54 xoffset=3 yoffset=14 xadvance=47 page=0 chnl=0 -char id=69 x=137 y=212 width=38 height=54 xoffset=3 yoffset=14 xadvance=41 page=0 chnl=0 -char id=70 x=475 y=156 width=36 height=54 xoffset=3 yoffset=14 xadvance=39 page=0 chnl=0 -char id=71 x=83 y=99 width=45 height=56 xoffset=2 yoffset=13 xadvance=49 page=0 chnl=0 -char id=72 x=175 y=212 width=45 height=54 xoffset=3 yoffset=14 xadvance=51 page=0 chnl=0 -char id=73 x=220 y=212 width=14 height=54 xoffset=4 yoffset=14 xadvance=22 page=0 chnl=0 -char id=74 x=264 y=156 width=37 height=55 xoffset=0 yoffset=14 xadvance=40 page=0 chnl=0 -char id=75 x=234 y=212 width=45 height=54 xoffset=3 yoffset=14 xadvance=46 page=0 chnl=0 -char id=76 x=279 y=212 width=36 height=54 xoffset=3 yoffset=14 xadvance=39 page=0 chnl=0 -char id=77 x=315 y=212 width=58 height=54 xoffset=3 yoffset=14 xadvance=63 page=0 chnl=0 -char id=78 x=373 y=212 width=45 height=54 xoffset=3 yoffset=14 xadvance=51 page=0 chnl=0 -char id=79 x=128 y=99 width=47 height=56 xoffset=1 yoffset=13 xadvance=50 page=0 chnl=0 -char id=80 x=418 y=212 width=43 height=54 xoffset=3 yoffset=14 xadvance=48 page=0 chnl=0 -char id=81 x=319 y=0 width=47 height=65 xoffset=2 yoffset=13 xadvance=50 page=0 chnl=0 -char id=82 x=461 y=212 width=43 height=54 xoffset=3 yoffset=14 xadvance=46 page=0 chnl=0 -char id=83 x=175 y=99 width=42 height=56 xoffset=1 yoffset=13 xadvance=44 page=0 chnl=0 -char id=84 x=0 y=266 width=45 height=54 xoffset=0 yoffset=14 xadvance=45 page=0 chnl=0 -char id=85 x=301 y=156 width=42 height=55 xoffset=3 yoffset=14 xadvance=48 page=0 chnl=0 -char id=86 x=45 y=266 width=51 height=54 xoffset=-2 yoffset=14 xadvance=48 page=0 chnl=0 -char id=87 x=96 y=266 width=64 height=54 xoffset=-1 yoffset=14 xadvance=63 page=0 chnl=0 -char id=88 x=160 y=266 width=48 height=54 xoffset=-1 yoffset=14 xadvance=46 page=0 chnl=0 -char id=89 x=208 y=266 width=49 height=54 xoffset=-2 yoffset=14 xadvance=45 page=0 chnl=0 -char id=90 x=257 y=266 width=42 height=54 xoffset=1 yoffset=14 xadvance=44 page=0 chnl=0 -char id=91 x=115 y=0 width=18 height=75 xoffset=3 yoffset=5 xadvance=21 page=0 chnl=0 -char id=92 x=403 y=0 width=37 height=58 xoffset=-2 yoffset=14 xadvance=31 page=0 chnl=0 -char id=93 x=133 y=0 width=18 height=75 xoffset=0 yoffset=5 xadvance=21 page=0 chnl=0 -char id=94 x=139 y=362 width=33 height=28 xoffset=0 yoffset=14 xadvance=32 page=0 chnl=0 -char id=95 x=331 y=362 width=34 height=12 xoffset=-1 yoffset=65 xadvance=33 page=0 chnl=0 -char id=96 x=285 y=362 width=23 height=13 xoffset=0 yoffset=12 xadvance=24 page=0 chnl=0 -char id=97 x=0 y=320 width=37 height=42 xoffset=1 yoffset=27 xadvance=38 page=0 chnl=0 -char id=98 x=440 y=0 width=37 height=57 xoffset=2 yoffset=12 xadvance=40 page=0 chnl=0 -char id=99 x=37 y=320 width=36 height=42 xoffset=1 yoffset=27 xadvance=38 page=0 chnl=0 -char id=100 x=0 y=99 width=37 height=57 xoffset=1 yoffset=12 xadvance=40 page=0 chnl=0 -char id=101 x=73 y=320 width=38 height=42 xoffset=1 yoffset=27 xadvance=39 page=0 chnl=0 -char id=102 x=477 y=0 width=28 height=57 xoffset=0 yoffset=11 xadvance=27 page=0 chnl=0 -char id=103 x=217 y=99 width=38 height=56 xoffset=1 yoffset=27 xadvance=41 page=0 chnl=0 -char id=104 x=255 y=99 width=36 height=56 xoffset=2 yoffset=12 xadvance=40 page=0 chnl=0 -char id=105 x=291 y=99 width=15 height=56 xoffset=2 yoffset=12 xadvance=19 page=0 chnl=0 -char id=106 x=197 y=0 width=23 height=71 xoffset=-5 yoffset=12 xadvance=20 page=0 chnl=0 -char id=107 x=306 y=99 width=40 height=56 xoffset=2 yoffset=12 xadvance=39 page=0 chnl=0 -char id=108 x=346 y=99 width=14 height=56 xoffset=3 yoffset=12 xadvance=20 page=0 chnl=0 -char id=109 x=186 y=320 width=58 height=41 xoffset=2 yoffset=27 xadvance=63 page=0 chnl=0 -char id=110 x=244 y=320 width=36 height=41 xoffset=2 yoffset=27 xadvance=40 page=0 chnl=0 -char id=111 x=111 y=320 width=39 height=42 xoffset=1 yoffset=27 xadvance=41 page=0 chnl=0 -char id=112 x=360 y=99 width=37 height=56 xoffset=2 yoffset=27 xadvance=40 page=0 chnl=0 -char id=113 x=397 y=99 width=37 height=56 xoffset=1 yoffset=27 xadvance=40 page=0 chnl=0 -char id=114 x=486 y=266 width=25 height=41 xoffset=2 yoffset=27 xadvance=27 page=0 chnl=0 -char id=115 x=150 y=320 width=36 height=42 xoffset=0 yoffset=27 xadvance=37 page=0 chnl=0 -char id=116 x=445 y=266 width=26 height=51 xoffset=0 yoffset=18 xadvance=25 page=0 chnl=0 -char id=117 x=280 y=320 width=36 height=41 xoffset=2 yoffset=28 xadvance=40 page=0 chnl=0 -char id=118 x=316 y=320 width=39 height=40 xoffset=-1 yoffset=28 xadvance=37 page=0 chnl=0 -char id=119 x=355 y=320 width=54 height=40 xoffset=-1 yoffset=28 xadvance=52 page=0 chnl=0 -char id=120 x=409 y=320 width=40 height=40 xoffset=-1 yoffset=28 xadvance=37 page=0 chnl=0 -char id=121 x=343 y=156 width=40 height=55 xoffset=-1 yoffset=28 xadvance=37 page=0 chnl=0 -char id=122 x=449 y=320 width=34 height=40 xoffset=1 yoffset=28 xadvance=36 page=0 chnl=0 -char id=123 x=151 y=0 width=23 height=72 xoffset=0 yoffset=9 xadvance=23 page=0 chnl=0 -char id=124 x=366 y=0 width=8 height=63 xoffset=5 yoffset=14 xadvance=18 page=0 chnl=0 -char id=125 x=174 y=0 width=23 height=72 xoffset=0 yoffset=9 xadvance=23 page=0 chnl=0 -char id=126 x=229 y=362 width=41 height=19 xoffset=2 yoffset=36 xadvance=45 page=0 chnl=0 -char id=127 x=0 y=0 width=70 height=99 xoffset=2 yoffset=-11 xadvance=74 page=0 chnl=0 -kernings count=385 -kerning first=84 second=74 amount=-8 -kerning first=86 second=100 amount=-2 -kerning first=114 second=113 amount=-1 -kerning first=70 second=121 amount=-1 -kerning first=34 second=99 amount=-2 -kerning first=70 second=99 amount=-1 -kerning first=69 second=99 amount=-1 -kerning first=88 second=113 amount=-1 -kerning first=84 second=46 amount=-9 -kerning first=87 second=97 amount=-1 -kerning first=90 second=117 amount=-1 -kerning first=39 second=97 amount=-2 -kerning first=69 second=111 amount=-1 -kerning first=87 second=41 amount=1 -kerning first=121 second=34 amount=1 -kerning first=40 second=86 amount=1 -kerning first=85 second=65 amount=-1 -kerning first=72 second=65 amount=1 -kerning first=114 second=102 amount=1 -kerning first=89 second=42 amount=-2 -kerning first=114 second=34 amount=1 -kerning first=75 second=67 amount=-1 -kerning first=89 second=85 amount=-3 -kerning first=77 second=88 amount=1 -kerning first=84 second=115 amount=-3 -kerning first=84 second=71 amount=-1 -kerning first=89 second=101 amount=-2 -kerning first=89 second=45 amount=-5 -kerning first=78 second=88 amount=1 -kerning first=68 second=89 amount=-2 -kerning first=122 second=103 amount=-1 -kerning first=78 second=84 amount=-1 -kerning first=86 second=103 amount=-2 -kerning first=89 second=79 amount=-1 -kerning first=75 second=111 amount=-1 -kerning first=111 second=120 amount=-1 -kerning first=87 second=44 amount=-5 -kerning first=67 second=84 amount=-1 -kerning first=84 second=111 amount=-7 -kerning first=84 second=83 amount=-1 -kerning first=102 second=113 amount=-1 -kerning first=39 second=101 amount=-2 -kerning first=80 second=88 amount=-2 -kerning first=66 second=84 amount=-1 -kerning first=65 second=87 amount=-1 -kerning first=122 second=100 amount=-1 -kerning first=75 second=118 amount=-1 -kerning first=73 second=65 amount=1 -kerning first=70 second=118 amount=-1 -kerning first=73 second=88 amount=1 -kerning first=82 second=89 amount=-2 -kerning first=65 second=34 amount=-4 -kerning first=120 second=99 amount=-1 -kerning first=84 second=99 amount=-3 -kerning first=84 second=65 amount=-4 -kerning first=112 second=39 amount=-1 -kerning first=76 second=39 amount=-10 -kerning first=78 second=65 amount=1 -kerning first=88 second=45 amount=-5 -kerning first=34 second=111 amount=-3 -kerning first=114 second=99 amount=-1 -kerning first=86 second=125 amount=1 -kerning first=70 second=111 amount=-1 -kerning first=89 second=120 amount=-1 -kerning first=90 second=119 amount=-1 -kerning first=89 second=89 amount=1 -kerning first=89 second=117 amount=-1 -kerning first=75 second=117 amount=-1 -kerning first=76 second=65 amount=1 -kerning first=34 second=34 amount=-1 -kerning first=89 second=110 amount=-1 -kerning first=88 second=101 amount=-1 -kerning first=107 second=103 amount=-1 -kerning first=34 second=115 amount=-3 -kerning first=80 second=44 amount=-14 -kerning first=98 second=39 amount=-1 -kerning first=70 second=65 amount=-7 -kerning first=89 second=116 amount=-1 -kerning first=70 second=46 amount=-10 -kerning first=98 second=34 amount=-1 -kerning first=70 second=84 amount=1 -kerning first=114 second=100 amount=-1 -kerning first=88 second=79 amount=-1 -kerning first=39 second=113 amount=-2 -kerning first=65 second=118 amount=-2 -kerning first=114 second=103 amount=-1 -kerning first=77 second=65 amount=1 -kerning first=120 second=103 amount=-1 -kerning first=65 second=110 amount=-2 -kerning first=114 second=121 amount=1 -kerning first=89 second=100 amount=-2 -kerning first=80 second=65 amount=-6 -kerning first=121 second=111 amount=-1 -kerning first=34 second=101 amount=-2 -kerning first=122 second=111 amount=-1 -kerning first=114 second=118 amount=1 -kerning first=102 second=41 amount=1 -kerning first=122 second=113 amount=-1 -kerning first=89 second=122 amount=-1 -kerning first=68 second=88 amount=-1 -kerning first=81 second=89 amount=-1 -kerning first=114 second=111 amount=-1 -kerning first=46 second=34 amount=-10 -kerning first=84 second=112 amount=-3 -kerning first=76 second=34 amount=-10 -kerning first=39 second=115 amount=-3 -kerning first=76 second=118 amount=-4 -kerning first=86 second=99 amount=-2 -kerning first=84 second=84 amount=1 -kerning first=120 second=111 amount=-1 -kerning first=65 second=79 amount=-1 -kerning first=87 second=101 amount=-1 -kerning first=67 second=125 amount=-1 -kerning first=120 second=113 amount=-1 -kerning first=118 second=46 amount=-6 -kerning first=88 second=103 amount=-1 -kerning first=111 second=122 amount=-1 -kerning first=77 second=84 amount=-1 -kerning first=114 second=46 amount=-6 -kerning first=34 second=39 amount=-1 -kerning first=65 second=121 amount=-2 -kerning first=114 second=44 amount=-6 -kerning first=69 second=84 amount=1 -kerning first=89 second=46 amount=-8 -kerning first=97 second=39 amount=-1 -kerning first=34 second=100 amount=-2 -kerning first=70 second=100 amount=-1 -kerning first=84 second=120 amount=-3 -kerning first=90 second=118 amount=-1 -kerning first=70 second=114 amount=-1 -kerning first=34 second=112 amount=-1 -kerning first=89 second=86 amount=1 -kerning first=86 second=113 amount=-2 -kerning first=88 second=71 amount=-1 -kerning first=122 second=99 amount=-1 -kerning first=66 second=89 amount=-2 -kerning first=102 second=103 amount=-1 -kerning first=88 second=67 amount=-1 -kerning first=39 second=110 amount=-1 -kerning first=88 second=117 amount=-1 -kerning first=89 second=118 amount=-1 -kerning first=97 second=118 amount=-1 -kerning first=87 second=65 amount=-2 -kerning first=89 second=67 amount=-1 -kerning first=89 second=74 amount=-3 -kerning first=102 second=101 amount=-1 -kerning first=86 second=111 amount=-2 -kerning first=65 second=119 amount=-1 -kerning first=84 second=100 amount=-3 -kerning first=120 second=100 amount=-1 -kerning first=104 second=34 amount=-3 -kerning first=86 second=41 amount=1 -kerning first=111 second=34 amount=-3 -kerning first=40 second=89 amount=1 -kerning first=121 second=39 amount=1 -kerning first=70 second=74 amount=-7 -kerning first=68 second=90 amount=-1 -kerning first=98 second=120 amount=-1 -kerning first=110 second=34 amount=-3 -kerning first=119 second=46 amount=-4 -kerning first=69 second=102 amount=-1 -kerning first=118 second=44 amount=-6 -kerning first=84 second=114 amount=-2 -kerning first=86 second=97 amount=-2 -kerning first=40 second=87 amount=1 -kerning first=65 second=109 amount=-2 -kerning first=68 second=86 amount=-1 -kerning first=86 second=93 amount=1 -kerning first=65 second=67 amount=-1 -kerning first=97 second=34 amount=-1 -kerning first=34 second=65 amount=-4 -kerning first=84 second=118 amount=-3 -kerning first=112 second=34 amount=-1 -kerning first=76 second=84 amount=-7 -kerning first=107 second=99 amount=-1 -kerning first=123 second=85 amount=-1 -kerning first=102 second=125 amount=1 -kerning first=65 second=63 amount=-3 -kerning first=89 second=44 amount=-8 -kerning first=80 second=118 amount=1 -kerning first=112 second=122 amount=-1 -kerning first=79 second=65 amount=-1 -kerning first=80 second=121 amount=1 -kerning first=118 second=34 amount=1 -kerning first=87 second=45 amount=-2 -kerning first=69 second=100 amount=-1 -kerning first=87 second=103 amount=-1 -kerning first=112 second=120 amount=-1 -kerning first=86 second=65 amount=-3 -kerning first=65 second=81 amount=-1 -kerning first=68 second=44 amount=-4 -kerning first=86 second=45 amount=-6 -kerning first=39 second=34 amount=-1 -kerning first=72 second=88 amount=1 -kerning first=68 second=46 amount=-4 -kerning first=65 second=89 amount=-5 -kerning first=69 second=118 amount=-1 -kerning first=89 second=38 amount=-1 -kerning first=88 second=99 amount=-1 -kerning first=65 second=71 amount=-1 -kerning first=91 second=74 amount=-1 -kerning first=75 second=101 amount=-1 -kerning first=39 second=112 amount=-1 -kerning first=70 second=113 amount=-1 -kerning first=119 second=44 amount=-4 -kerning first=72 second=89 amount=-1 -kerning first=90 second=103 amount=-1 -kerning first=65 second=86 amount=-3 -kerning first=84 second=119 amount=-2 -kerning first=34 second=110 amount=-1 -kerning first=39 second=109 amount=-1 -kerning first=75 second=81 amount=-1 -kerning first=89 second=115 amount=-2 -kerning first=89 second=87 amount=1 -kerning first=114 second=101 amount=-1 -kerning first=116 second=111 amount=-1 -kerning first=90 second=100 amount=-1 -kerning first=79 second=89 amount=-2 -kerning first=84 second=122 amount=-2 -kerning first=68 second=84 amount=-3 -kerning first=76 second=86 amount=-7 -kerning first=74 second=65 amount=-1 -kerning first=107 second=101 amount=-1 -kerning first=80 second=46 amount=-14 -kerning first=89 second=93 amount=1 -kerning first=89 second=65 amount=-5 -kerning first=87 second=117 amount=-1 -kerning first=89 second=81 amount=-1 -kerning first=39 second=103 amount=-2 -kerning first=86 second=101 amount=-2 -kerning first=86 second=117 amount=-1 -kerning first=84 second=113 amount=-3 -kerning first=87 second=46 amount=-5 -kerning first=47 second=47 amount=-9 -kerning first=75 second=103 amount=-1 -kerning first=89 second=84 amount=1 -kerning first=84 second=110 amount=-3 -kerning first=39 second=99 amount=-2 -kerning first=88 second=121 amount=-1 -kerning first=65 second=39 amount=-4 -kerning first=110 second=39 amount=-3 -kerning first=88 second=118 amount=-1 -kerning first=86 second=114 amount=-1 -kerning first=80 second=74 amount=-6 -kerning first=84 second=97 amount=-6 -kerning first=82 second=84 amount=-2 -kerning first=91 second=85 amount=-1 -kerning first=102 second=99 amount=-1 -kerning first=66 second=86 amount=-1 -kerning first=120 second=101 amount=-1 -kerning first=102 second=93 amount=1 -kerning first=75 second=100 amount=-1 -kerning first=84 second=79 amount=-1 -kerning first=44 second=39 amount=-10 -kerning first=111 second=121 amount=-1 -kerning first=75 second=121 amount=-1 -kerning first=81 second=87 amount=-1 -kerning first=107 second=113 amount=-1 -kerning first=90 second=79 amount=-1 -kerning first=89 second=114 amount=-1 -kerning first=122 second=101 amount=-1 -kerning first=111 second=118 amount=-1 -kerning first=82 second=86 amount=-1 -kerning first=70 second=101 amount=-1 -kerning first=114 second=97 amount=-1 -kerning first=70 second=97 amount=-1 -kerning first=34 second=97 amount=-2 -kerning first=89 second=102 amount=-1 -kerning first=78 second=89 amount=-1 -kerning first=70 second=44 amount=-10 -kerning first=104 second=39 amount=-3 -kerning first=84 second=45 amount=-10 -kerning first=89 second=121 amount=-1 -kerning first=109 second=34 amount=-3 -kerning first=84 second=86 amount=1 -kerning first=87 second=99 amount=-1 -kerning first=32 second=84 amount=-2 -kerning first=98 second=122 amount=-1 -kerning first=89 second=112 amount=-1 -kerning first=89 second=103 amount=-2 -kerning first=65 second=116 amount=-1 -kerning first=88 second=81 amount=-1 -kerning first=102 second=34 amount=1 -kerning first=109 second=39 amount=-3 -kerning first=81 second=84 amount=-1 -kerning first=121 second=97 amount=-1 -kerning first=89 second=99 amount=-2 -kerning first=89 second=125 amount=1 -kerning first=81 second=86 amount=-1 -kerning first=114 second=116 amount=2 -kerning first=114 second=119 amount=1 -kerning first=84 second=44 amount=-9 -kerning first=102 second=39 amount=1 -kerning first=44 second=34 amount=-10 -kerning first=34 second=109 amount=-1 -kerning first=84 second=101 amount=-3 -kerning first=75 second=119 amount=-2 -kerning first=84 second=81 amount=-1 -kerning first=76 second=121 amount=-4 -kerning first=69 second=101 amount=-1 -kerning first=80 second=90 amount=-1 -kerning first=89 second=97 amount=-2 -kerning first=89 second=109 amount=-1 -kerning first=90 second=99 amount=-1 -kerning first=79 second=88 amount=-1 -kerning first=70 second=103 amount=-1 -kerning first=34 second=103 amount=-2 -kerning first=84 second=67 amount=-1 -kerning first=76 second=79 amount=-2 -kerning first=34 second=113 amount=-2 -kerning first=89 second=41 amount=1 -kerning first=75 second=71 amount=-1 -kerning first=76 second=87 amount=-3 -kerning first=77 second=89 amount=-1 -kerning first=90 second=113 amount=-1 -kerning first=118 second=111 amount=-1 -kerning first=118 second=97 amount=-1 -kerning first=88 second=100 amount=-1 -kerning first=89 second=111 amount=-2 -kerning first=90 second=121 amount=-1 -kerning first=89 second=113 amount=-2 -kerning first=84 second=87 amount=1 -kerning first=39 second=111 amount=-3 -kerning first=39 second=100 amount=-2 -kerning first=75 second=113 amount=-1 -kerning first=88 second=111 amount=-1 -kerning first=87 second=111 amount=-1 -kerning first=89 second=83 amount=-1 -kerning first=84 second=89 amount=1 -kerning first=84 second=103 amount=-3 -kerning first=70 second=117 amount=-1 -kerning first=67 second=41 amount=-1 -kerning first=89 second=71 amount=-1 -kerning first=121 second=44 amount=-6 -kerning first=97 second=121 amount=-1 -kerning first=87 second=113 amount=-1 -kerning first=73 second=84 amount=-1 -kerning first=121 second=46 amount=-6 -kerning first=75 second=99 amount=-1 -kerning first=65 second=112 amount=-2 -kerning first=65 second=85 amount=-1 -kerning first=76 second=67 amount=-2 -kerning first=76 second=81 amount=-2 -kerning first=102 second=100 amount=-1 -kerning first=75 second=79 amount=-1 -kerning first=39 second=65 amount=-4 -kerning first=65 second=84 amount=-4 -kerning first=90 second=101 amount=-1 -kerning first=84 second=121 amount=-3 -kerning first=114 second=39 amount=1 -kerning first=84 second=109 amount=-3 -kerning first=123 second=74 amount=-1 -kerning first=76 second=119 amount=-2 -kerning first=84 second=117 amount=-2 -kerning first=76 second=85 amount=-1 -kerning first=76 second=71 amount=-2 -kerning first=79 second=90 amount=-1 -kerning first=107 second=100 amount=-1 -kerning first=90 second=111 amount=-1 -kerning first=79 second=44 amount=-4 -kerning first=75 second=45 amount=-6 -kerning first=79 second=86 amount=-1 -kerning first=79 second=46 amount=-4 -kerning first=76 second=89 amount=-10 -kerning first=68 second=65 amount=-1 -kerning first=79 second=84 amount=-3 -kerning first=87 second=100 amount=-1 -kerning first=84 second=32 amount=-2 -kerning first=90 second=67 amount=-1 -kerning first=69 second=103 amount=-1 -kerning first=90 second=71 amount=-1 -kerning first=86 second=44 amount=-8 -kerning first=69 second=121 amount=-1 -kerning first=87 second=114 amount=-1 -kerning first=118 second=39 amount=1 -kerning first=46 second=39 amount=-10 -kerning first=72 second=84 amount=-1 -kerning first=86 second=46 amount=-8 -kerning first=69 second=113 amount=-1 -kerning first=69 second=119 amount=-1 -kerning first=73 second=89 amount=-1 -kerning first=39 second=39 amount=-1 -kerning first=69 second=117 amount=-1 -kerning first=111 second=39 amount=-3 -kerning first=90 second=81 amount=-1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/web/static/fonts/bmfonts/RobotoMono72White.fnt b/src/web/static/fonts/bmfonts/RobotoMono72White.fnt index b9be89b4..10ccee57 100644 --- a/src/web/static/fonts/bmfonts/RobotoMono72White.fnt +++ b/src/web/static/fonts/bmfonts/RobotoMono72White.fnt @@ -1,103 +1,110 @@ -info face="Roboto Mono" size=72 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2 -common lineHeight=96 base=76 scaleW=512 scaleH=512 pages=1 packed=0 -page id=0 file="RobotoMono72White.png" -chars count=98 -char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=75 xadvance=0 page=0 chnl=0 -char id=10 x=0 y=0 width=45 height=99 xoffset=-1 yoffset=-2 xadvance=43 page=0 chnl=0 -char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=75 xadvance=43 page=0 chnl=0 -char id=33 x=498 y=99 width=10 height=55 xoffset=16 yoffset=23 xadvance=43 page=0 chnl=0 -char id=34 x=434 y=319 width=20 height=19 xoffset=11 yoffset=21 xadvance=43 page=0 chnl=0 -char id=35 x=175 y=265 width=41 height=54 xoffset=1 yoffset=23 xadvance=43 page=0 chnl=0 -char id=36 x=200 y=0 width=35 height=69 xoffset=5 yoffset=15 xadvance=43 page=0 chnl=0 -char id=37 x=0 y=155 width=42 height=56 xoffset=1 yoffset=22 xadvance=44 page=0 chnl=0 -char id=38 x=42 y=155 width=41 height=56 xoffset=3 yoffset=22 xadvance=44 page=0 chnl=0 -char id=39 x=502 y=211 width=7 height=19 xoffset=16 yoffset=21 xadvance=43 page=0 chnl=0 -char id=40 x=45 y=0 width=21 height=78 xoffset=12 yoffset=16 xadvance=44 page=0 chnl=0 -char id=41 x=66 y=0 width=22 height=78 xoffset=9 yoffset=16 xadvance=43 page=0 chnl=0 -char id=42 x=256 y=319 width=37 height=37 xoffset=4 yoffset=32 xadvance=43 page=0 chnl=0 -char id=43 x=219 y=319 width=37 height=40 xoffset=3 yoffset=32 xadvance=43 page=0 chnl=0 -char id=44 x=421 y=319 width=13 height=22 xoffset=11 yoffset=67 xadvance=43 page=0 chnl=0 -char id=45 x=17 y=360 width=29 height=8 xoffset=7 yoffset=49 xadvance=44 page=0 chnl=0 -char id=46 x=496 y=319 width=12 height=13 xoffset=16 yoffset=65 xadvance=43 page=0 chnl=0 -char id=47 x=319 y=0 width=31 height=58 xoffset=7 yoffset=23 xadvance=43 page=0 chnl=0 -char id=48 x=431 y=99 width=35 height=56 xoffset=4 yoffset=22 xadvance=43 page=0 chnl=0 -char id=49 x=36 y=265 width=23 height=54 xoffset=6 yoffset=23 xadvance=44 page=0 chnl=0 -char id=50 x=189 y=155 width=37 height=55 xoffset=2 yoffset=22 xadvance=44 page=0 chnl=0 -char id=51 x=361 y=99 width=35 height=56 xoffset=2 yoffset=22 xadvance=43 page=0 chnl=0 -char id=52 x=59 y=265 width=39 height=54 xoffset=2 yoffset=23 xadvance=44 page=0 chnl=0 -char id=53 x=226 y=155 width=35 height=55 xoffset=5 yoffset=23 xadvance=43 page=0 chnl=0 -char id=54 x=261 y=155 width=35 height=55 xoffset=4 yoffset=23 xadvance=43 page=0 chnl=0 -char id=55 x=98 y=265 width=37 height=54 xoffset=3 yoffset=23 xadvance=44 page=0 chnl=0 -char id=56 x=396 y=99 width=35 height=56 xoffset=5 yoffset=22 xadvance=43 page=0 chnl=0 -char id=57 x=296 y=155 width=34 height=55 xoffset=4 yoffset=22 xadvance=43 page=0 chnl=0 -char id=58 x=490 y=211 width=12 height=43 xoffset=18 yoffset=35 xadvance=43 page=0 chnl=0 -char id=59 x=486 y=0 width=14 height=55 xoffset=16 yoffset=35 xadvance=43 page=0 chnl=0 -char id=60 x=293 y=319 width=32 height=35 xoffset=5 yoffset=36 xadvance=43 page=0 chnl=0 -char id=61 x=388 y=319 width=33 height=23 xoffset=5 yoffset=41 xadvance=43 page=0 chnl=0 -char id=62 x=325 y=319 width=33 height=35 xoffset=5 yoffset=36 xadvance=43 page=0 chnl=0 -char id=63 x=466 y=99 width=32 height=56 xoffset=6 yoffset=22 xadvance=43 page=0 chnl=0 -char id=64 x=135 y=265 width=40 height=54 xoffset=1 yoffset=23 xadvance=42 page=0 chnl=0 -char id=65 x=330 y=155 width=42 height=54 xoffset=1 yoffset=23 xadvance=43 page=0 chnl=0 -char id=66 x=372 y=155 width=35 height=54 xoffset=5 yoffset=23 xadvance=43 page=0 chnl=0 -char id=67 x=448 y=0 width=38 height=56 xoffset=3 yoffset=22 xadvance=43 page=0 chnl=0 -char id=68 x=407 y=155 width=37 height=54 xoffset=4 yoffset=23 xadvance=43 page=0 chnl=0 -char id=69 x=444 y=155 width=34 height=54 xoffset=5 yoffset=23 xadvance=43 page=0 chnl=0 -char id=70 x=0 y=211 width=34 height=54 xoffset=6 yoffset=23 xadvance=44 page=0 chnl=0 -char id=71 x=0 y=99 width=38 height=56 xoffset=3 yoffset=22 xadvance=44 page=0 chnl=0 -char id=72 x=34 y=211 width=36 height=54 xoffset=4 yoffset=23 xadvance=43 page=0 chnl=0 -char id=73 x=478 y=155 width=33 height=54 xoffset=5 yoffset=23 xadvance=43 page=0 chnl=0 -char id=74 x=83 y=155 width=36 height=55 xoffset=2 yoffset=23 xadvance=43 page=0 chnl=0 -char id=75 x=70 y=211 width=38 height=54 xoffset=5 yoffset=23 xadvance=43 page=0 chnl=0 -char id=76 x=108 y=211 width=34 height=54 xoffset=6 yoffset=23 xadvance=43 page=0 chnl=0 -char id=77 x=142 y=211 width=36 height=54 xoffset=4 yoffset=23 xadvance=43 page=0 chnl=0 -char id=78 x=178 y=211 width=35 height=54 xoffset=4 yoffset=23 xadvance=43 page=0 chnl=0 -char id=79 x=38 y=99 width=38 height=56 xoffset=3 yoffset=22 xadvance=43 page=0 chnl=0 -char id=80 x=213 y=211 width=36 height=54 xoffset=6 yoffset=23 xadvance=43 page=0 chnl=0 -char id=81 x=242 y=0 width=40 height=64 xoffset=2 yoffset=22 xadvance=43 page=0 chnl=0 -char id=82 x=249 y=211 width=36 height=54 xoffset=5 yoffset=23 xadvance=43 page=0 chnl=0 -char id=83 x=76 y=99 width=38 height=56 xoffset=3 yoffset=22 xadvance=44 page=0 chnl=0 -char id=84 x=285 y=211 width=40 height=54 xoffset=2 yoffset=23 xadvance=44 page=0 chnl=0 -char id=85 x=119 y=155 width=36 height=55 xoffset=4 yoffset=23 xadvance=43 page=0 chnl=0 -char id=86 x=325 y=211 width=41 height=54 xoffset=1 yoffset=23 xadvance=43 page=0 chnl=0 -char id=87 x=366 y=211 width=42 height=54 xoffset=1 yoffset=23 xadvance=43 page=0 chnl=0 -char id=88 x=408 y=211 width=41 height=54 xoffset=2 yoffset=23 xadvance=43 page=0 chnl=0 -char id=89 x=449 y=211 width=41 height=54 xoffset=1 yoffset=23 xadvance=43 page=0 chnl=0 -char id=90 x=0 y=265 width=36 height=54 xoffset=3 yoffset=23 xadvance=43 page=0 chnl=0 -char id=91 x=88 y=0 width=16 height=72 xoffset=14 yoffset=16 xadvance=43 page=0 chnl=0 -char id=92 x=350 y=0 width=30 height=58 xoffset=7 yoffset=23 xadvance=43 page=0 chnl=0 -char id=93 x=104 y=0 width=17 height=72 xoffset=13 yoffset=16 xadvance=44 page=0 chnl=0 -char id=94 x=358 y=319 width=30 height=30 xoffset=7 yoffset=23 xadvance=43 page=0 chnl=0 -char id=95 x=46 y=360 width=34 height=8 xoffset=4 yoffset=74 xadvance=43 page=0 chnl=0 -char id=96 x=0 y=360 width=17 height=12 xoffset=13 yoffset=22 xadvance=43 page=0 chnl=0 -char id=97 x=251 y=265 width=35 height=42 xoffset=4 yoffset=36 xadvance=43 page=0 chnl=0 -char id=98 x=380 y=0 width=34 height=57 xoffset=5 yoffset=21 xadvance=43 page=0 chnl=0 -char id=99 x=286 y=265 width=35 height=42 xoffset=4 yoffset=36 xadvance=43 page=0 chnl=0 -char id=100 x=414 y=0 width=34 height=57 xoffset=4 yoffset=21 xadvance=43 page=0 chnl=0 -char id=101 x=321 y=265 width=36 height=42 xoffset=4 yoffset=36 xadvance=43 page=0 chnl=0 -char id=102 x=282 y=0 width=37 height=58 xoffset=4 yoffset=19 xadvance=43 page=0 chnl=0 -char id=103 x=114 y=99 width=34 height=56 xoffset=4 yoffset=36 xadvance=43 page=0 chnl=0 -char id=104 x=148 y=99 width=34 height=56 xoffset=5 yoffset=21 xadvance=43 page=0 chnl=0 -char id=105 x=155 y=155 width=34 height=55 xoffset=6 yoffset=22 xadvance=43 page=0 chnl=0 -char id=106 x=121 y=0 width=26 height=71 xoffset=6 yoffset=22 xadvance=44 page=0 chnl=0 -char id=107 x=182 y=99 width=36 height=56 xoffset=5 yoffset=21 xadvance=43 page=0 chnl=0 -char id=108 x=218 y=99 width=34 height=56 xoffset=6 yoffset=21 xadvance=43 page=0 chnl=0 -char id=109 x=428 y=265 width=39 height=41 xoffset=2 yoffset=36 xadvance=43 page=0 chnl=0 -char id=110 x=467 y=265 width=34 height=41 xoffset=5 yoffset=36 xadvance=43 page=0 chnl=0 -char id=111 x=357 y=265 width=37 height=42 xoffset=3 yoffset=36 xadvance=43 page=0 chnl=0 -char id=112 x=252 y=99 width=34 height=56 xoffset=5 yoffset=36 xadvance=43 page=0 chnl=0 -char id=113 x=286 y=99 width=34 height=56 xoffset=4 yoffset=36 xadvance=43 page=0 chnl=0 -char id=114 x=0 y=319 width=29 height=41 xoffset=11 yoffset=36 xadvance=44 page=0 chnl=0 -char id=115 x=394 y=265 width=34 height=42 xoffset=5 yoffset=36 xadvance=43 page=0 chnl=0 -char id=116 x=216 y=265 width=35 height=51 xoffset=4 yoffset=27 xadvance=43 page=0 chnl=0 -char id=117 x=29 y=319 width=33 height=41 xoffset=5 yoffset=37 xadvance=43 page=0 chnl=0 -char id=118 x=62 y=319 width=39 height=40 xoffset=2 yoffset=37 xadvance=43 page=0 chnl=0 -char id=119 x=101 y=319 width=43 height=40 xoffset=0 yoffset=37 xadvance=43 page=0 chnl=0 -char id=120 x=144 y=319 width=40 height=40 xoffset=2 yoffset=37 xadvance=43 page=0 chnl=0 -char id=121 x=320 y=99 width=41 height=56 xoffset=1 yoffset=37 xadvance=43 page=0 chnl=0 -char id=122 x=184 y=319 width=35 height=40 xoffset=5 yoffset=37 xadvance=44 page=0 chnl=0 -char id=123 x=147 y=0 width=26 height=71 xoffset=10 yoffset=19 xadvance=43 page=0 chnl=0 -char id=124 x=235 y=0 width=7 height=68 xoffset=18 yoffset=23 xadvance=43 page=0 chnl=0 -char id=125 x=173 y=0 width=27 height=71 xoffset=10 yoffset=19 xadvance=44 page=0 chnl=0 -char id=126 x=454 y=319 width=42 height=16 xoffset=1 yoffset=47 xadvance=44 page=0 chnl=0 -char id=127 x=0 y=0 width=45 height=99 xoffset=-1 yoffset=-2 xadvance=43 page=0 chnl=0 -kernings count=0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/web/static/fonts/bmfonts/RobotoSlab72White.fnt b/src/web/static/fonts/bmfonts/RobotoSlab72White.fnt index f1926d5c..97a2ab63 100644 --- a/src/web/static/fonts/bmfonts/RobotoSlab72White.fnt +++ b/src/web/static/fonts/bmfonts/RobotoSlab72White.fnt @@ -1,492 +1,498 @@ -info face="Roboto Slab Regular" size=72 bold=0 italic=0 charset="" unicode=0 stretchH=100 smooth=1 aa=1 padding=1,1,1,1 spacing=-2,-2 -common lineHeight=96 base=76 scaleW=512 scaleH=512 pages=1 packed=0 -page id=0 file="RobotoSlab72White.png" -chars count=98 -char id=0 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=75 xadvance=0 page=0 chnl=0 -char id=10 x=0 y=0 width=70 height=98 xoffset=0 yoffset=-1 xadvance=70 page=0 chnl=0 -char id=32 x=0 y=0 width=0 height=0 xoffset=-1 yoffset=75 xadvance=18 page=0 chnl=0 -char id=33 x=497 y=156 width=9 height=54 xoffset=4 yoffset=23 xadvance=17 page=0 chnl=0 -char id=34 x=191 y=362 width=19 height=20 xoffset=5 yoffset=20 xadvance=28 page=0 chnl=0 -char id=35 x=406 y=266 width=41 height=54 xoffset=1 yoffset=23 xadvance=43 page=0 chnl=0 -char id=36 x=212 y=0 width=35 height=69 xoffset=2 yoffset=15 xadvance=39 page=0 chnl=0 -char id=37 x=174 y=156 width=48 height=56 xoffset=2 yoffset=22 xadvance=52 page=0 chnl=0 -char id=38 x=222 y=156 width=44 height=56 xoffset=2 yoffset=22 xadvance=46 page=0 chnl=0 -char id=39 x=210 y=362 width=8 height=20 xoffset=5 yoffset=20 xadvance=17 page=0 chnl=0 -char id=40 x=70 y=0 width=21 height=77 xoffset=3 yoffset=17 xadvance=23 page=0 chnl=0 -char id=41 x=91 y=0 width=21 height=77 xoffset=-1 yoffset=17 xadvance=23 page=0 chnl=0 -char id=42 x=100 y=362 width=31 height=33 xoffset=1 yoffset=23 xadvance=33 page=0 chnl=0 -char id=43 x=0 y=362 width=37 height=40 xoffset=2 yoffset=32 xadvance=41 page=0 chnl=0 -char id=44 x=492 y=320 width=13 height=21 xoffset=-1 yoffset=67 xadvance=14 page=0 chnl=0 -char id=45 x=287 y=362 width=19 height=8 xoffset=4 yoffset=50 xadvance=27 page=0 chnl=0 -char id=46 x=278 y=362 width=9 height=9 xoffset=4 yoffset=68 xadvance=17 page=0 chnl=0 -char id=47 x=470 y=0 width=30 height=58 xoffset=-1 yoffset=23 xadvance=29 page=0 chnl=0 -char id=48 x=139 y=156 width=35 height=56 xoffset=3 yoffset=22 xadvance=41 page=0 chnl=0 -char id=49 x=305 y=266 width=25 height=54 xoffset=3 yoffset=23 xadvance=30 page=0 chnl=0 -char id=50 x=357 y=156 width=36 height=55 xoffset=2 yoffset=22 xadvance=40 page=0 chnl=0 -char id=51 x=0 y=156 width=34 height=56 xoffset=2 yoffset=22 xadvance=39 page=0 chnl=0 -char id=52 x=330 y=266 width=39 height=54 xoffset=1 yoffset=23 xadvance=42 page=0 chnl=0 -char id=53 x=393 y=156 width=33 height=55 xoffset=2 yoffset=23 xadvance=37 page=0 chnl=0 -char id=54 x=34 y=156 width=35 height=56 xoffset=3 yoffset=22 xadvance=40 page=0 chnl=0 -char id=55 x=369 y=266 width=37 height=54 xoffset=2 yoffset=23 xadvance=40 page=0 chnl=0 -char id=56 x=69 y=156 width=35 height=56 xoffset=2 yoffset=22 xadvance=39 page=0 chnl=0 -char id=57 x=104 y=156 width=35 height=56 xoffset=2 yoffset=22 xadvance=41 page=0 chnl=0 -char id=58 x=500 y=0 width=9 height=40 xoffset=4 yoffset=37 xadvance=15 page=0 chnl=0 -char id=59 x=447 y=266 width=13 height=52 xoffset=0 yoffset=37 xadvance=15 page=0 chnl=0 -char id=60 x=37 y=362 width=31 height=35 xoffset=2 yoffset=39 xadvance=36 page=0 chnl=0 -char id=61 x=160 y=362 width=31 height=23 xoffset=4 yoffset=40 xadvance=39 page=0 chnl=0 -char id=62 x=68 y=362 width=32 height=35 xoffset=3 yoffset=39 xadvance=37 page=0 chnl=0 -char id=63 x=480 y=98 width=31 height=55 xoffset=1 yoffset=22 xadvance=33 page=0 chnl=0 -char id=64 x=247 y=0 width=60 height=68 xoffset=1 yoffset=25 xadvance=64 page=0 chnl=0 -char id=65 x=426 y=156 width=51 height=54 xoffset=1 yoffset=23 xadvance=53 page=0 chnl=0 -char id=66 x=0 y=212 width=44 height=54 xoffset=1 yoffset=23 xadvance=47 page=0 chnl=0 -char id=67 x=191 y=98 width=42 height=56 xoffset=1 yoffset=22 xadvance=46 page=0 chnl=0 -char id=68 x=44 y=212 width=46 height=54 xoffset=1 yoffset=23 xadvance=50 page=0 chnl=0 -char id=69 x=90 y=212 width=42 height=54 xoffset=1 yoffset=23 xadvance=46 page=0 chnl=0 -char id=70 x=132 y=212 width=42 height=54 xoffset=1 yoffset=23 xadvance=44 page=0 chnl=0 -char id=71 x=233 y=98 width=43 height=56 xoffset=1 yoffset=22 xadvance=49 page=0 chnl=0 -char id=72 x=174 y=212 width=52 height=54 xoffset=1 yoffset=23 xadvance=55 page=0 chnl=0 -char id=73 x=477 y=156 width=20 height=54 xoffset=1 yoffset=23 xadvance=22 page=0 chnl=0 -char id=74 x=266 y=156 width=39 height=55 xoffset=1 yoffset=23 xadvance=41 page=0 chnl=0 -char id=75 x=226 y=212 width=48 height=54 xoffset=1 yoffset=23 xadvance=50 page=0 chnl=0 -char id=76 x=274 y=212 width=39 height=54 xoffset=1 yoffset=23 xadvance=42 page=0 chnl=0 -char id=77 x=313 y=212 width=64 height=54 xoffset=1 yoffset=23 xadvance=66 page=0 chnl=0 -char id=78 x=377 y=212 width=52 height=54 xoffset=1 yoffset=23 xadvance=54 page=0 chnl=0 -char id=79 x=276 y=98 width=47 height=56 xoffset=2 yoffset=22 xadvance=51 page=0 chnl=0 -char id=80 x=429 y=212 width=43 height=54 xoffset=1 yoffset=23 xadvance=45 page=0 chnl=0 -char id=81 x=307 y=0 width=48 height=64 xoffset=2 yoffset=22 xadvance=51 page=0 chnl=0 -char id=82 x=0 y=266 width=46 height=54 xoffset=1 yoffset=23 xadvance=48 page=0 chnl=0 -char id=83 x=323 y=98 width=38 height=56 xoffset=3 yoffset=22 xadvance=43 page=0 chnl=0 -char id=84 x=46 y=266 width=45 height=54 xoffset=0 yoffset=23 xadvance=45 page=0 chnl=0 -char id=85 x=305 y=156 width=52 height=55 xoffset=1 yoffset=23 xadvance=54 page=0 chnl=0 -char id=86 x=91 y=266 width=50 height=54 xoffset=1 yoffset=23 xadvance=52 page=0 chnl=0 -char id=87 x=141 y=266 width=67 height=54 xoffset=0 yoffset=23 xadvance=67 page=0 chnl=0 -char id=88 x=208 y=266 width=49 height=54 xoffset=1 yoffset=23 xadvance=51 page=0 chnl=0 -char id=89 x=257 y=266 width=48 height=54 xoffset=1 yoffset=23 xadvance=50 page=0 chnl=0 -char id=90 x=472 y=212 width=38 height=54 xoffset=2 yoffset=23 xadvance=42 page=0 chnl=0 -char id=91 x=180 y=0 width=16 height=72 xoffset=5 yoffset=16 xadvance=21 page=0 chnl=0 -char id=92 x=0 y=98 width=31 height=58 xoffset=0 yoffset=23 xadvance=30 page=0 chnl=0 -char id=93 x=196 y=0 width=16 height=72 xoffset=-1 yoffset=16 xadvance=19 page=0 chnl=0 -char id=94 x=131 y=362 width=29 height=28 xoffset=1 yoffset=23 xadvance=30 page=0 chnl=0 -char id=95 x=306 y=362 width=34 height=8 xoffset=3 yoffset=74 xadvance=40 page=0 chnl=0 -char id=96 x=260 y=362 width=18 height=12 xoffset=1 yoffset=22 xadvance=20 page=0 chnl=0 -char id=97 x=0 y=320 width=36 height=42 xoffset=3 yoffset=36 xadvance=41 page=0 chnl=0 -char id=98 x=363 y=0 width=41 height=58 xoffset=-2 yoffset=20 xadvance=42 page=0 chnl=0 -char id=99 x=36 y=320 width=34 height=42 xoffset=2 yoffset=36 xadvance=39 page=0 chnl=0 -char id=100 x=404 y=0 width=40 height=58 xoffset=2 yoffset=20 xadvance=43 page=0 chnl=0 -char id=101 x=70 y=320 width=34 height=42 xoffset=2 yoffset=36 xadvance=39 page=0 chnl=0 -char id=102 x=444 y=0 width=26 height=58 xoffset=1 yoffset=19 xadvance=25 page=0 chnl=0 -char id=103 x=31 y=98 width=34 height=57 xoffset=2 yoffset=36 xadvance=40 page=0 chnl=0 -char id=104 x=65 y=98 width=44 height=57 xoffset=1 yoffset=20 xadvance=46 page=0 chnl=0 -char id=105 x=109 y=98 width=20 height=57 xoffset=2 yoffset=20 xadvance=23 page=0 chnl=0 -char id=106 x=112 y=0 width=18 height=73 xoffset=-2 yoffset=20 xadvance=20 page=0 chnl=0 -char id=107 x=129 y=98 width=42 height=57 xoffset=1 yoffset=20 xadvance=44 page=0 chnl=0 -char id=108 x=171 y=98 width=20 height=57 xoffset=1 yoffset=20 xadvance=22 page=0 chnl=0 -char id=109 x=171 y=320 width=66 height=41 xoffset=1 yoffset=36 xadvance=68 page=0 chnl=0 -char id=110 x=237 y=320 width=44 height=41 xoffset=1 yoffset=36 xadvance=46 page=0 chnl=0 -char id=111 x=104 y=320 width=36 height=42 xoffset=2 yoffset=36 xadvance=40 page=0 chnl=0 -char id=112 x=361 y=98 width=40 height=56 xoffset=1 yoffset=36 xadvance=43 page=0 chnl=0 -char id=113 x=401 y=98 width=39 height=56 xoffset=2 yoffset=36 xadvance=40 page=0 chnl=0 -char id=114 x=484 y=266 width=27 height=41 xoffset=2 yoffset=36 xadvance=30 page=0 chnl=0 -char id=115 x=140 y=320 width=31 height=42 xoffset=3 yoffset=36 xadvance=36 page=0 chnl=0 -char id=116 x=460 y=266 width=24 height=51 xoffset=1 yoffset=27 xadvance=26 page=0 chnl=0 -char id=117 x=281 y=320 width=43 height=41 xoffset=0 yoffset=37 xadvance=44 page=0 chnl=0 -char id=118 x=324 y=320 width=39 height=40 xoffset=0 yoffset=37 xadvance=40 page=0 chnl=0 -char id=119 x=363 y=320 width=57 height=40 xoffset=1 yoffset=37 xadvance=59 page=0 chnl=0 -char id=120 x=420 y=320 width=40 height=40 xoffset=1 yoffset=37 xadvance=42 page=0 chnl=0 -char id=121 x=440 y=98 width=40 height=56 xoffset=0 yoffset=37 xadvance=41 page=0 chnl=0 -char id=122 x=460 y=320 width=32 height=40 xoffset=3 yoffset=37 xadvance=38 page=0 chnl=0 -char id=123 x=130 y=0 width=25 height=73 xoffset=1 yoffset=18 xadvance=25 page=0 chnl=0 -char id=124 x=355 y=0 width=8 height=63 xoffset=4 yoffset=23 xadvance=16 page=0 chnl=0 -char id=125 x=155 y=0 width=25 height=73 xoffset=-1 yoffset=18 xadvance=25 page=0 chnl=0 -char id=126 x=218 y=362 width=42 height=16 xoffset=3 yoffset=47 xadvance=49 page=0 chnl=0 -char id=127 x=0 y=0 width=70 height=98 xoffset=0 yoffset=-1 xadvance=70 page=0 chnl=0 -kernings count=389 -kerning first=86 second=45 amount=-1 -kerning first=114 second=46 amount=-4 -kerning first=40 second=87 amount=1 -kerning first=70 second=99 amount=-1 -kerning first=84 second=110 amount=-3 -kerning first=114 second=116 amount=1 -kerning first=39 second=65 amount=-4 -kerning first=104 second=34 amount=-1 -kerning first=89 second=71 amount=-1 -kerning first=107 second=113 amount=-1 -kerning first=78 second=88 amount=1 -kerning first=109 second=39 amount=-1 -kerning first=120 second=100 amount=-1 -kerning first=84 second=100 amount=-3 -kerning first=68 second=90 amount=-1 -kerning first=68 second=44 amount=-4 -kerning first=84 second=103 amount=-3 -kerning first=34 second=97 amount=-2 -kerning first=70 second=97 amount=-1 -kerning first=76 second=81 amount=-2 -kerning first=73 second=89 amount=-1 -kerning first=84 second=44 amount=-8 -kerning first=68 second=65 amount=-3 -kerning first=97 second=34 amount=-2 -kerning first=111 second=121 amount=-1 -kerning first=79 second=90 amount=-1 -kerning first=75 second=121 amount=-1 -kerning first=75 second=118 amount=-1 -kerning first=111 second=118 amount=-1 -kerning first=89 second=65 amount=-9 -kerning first=75 second=71 amount=-4 -kerning first=39 second=99 amount=-2 -kerning first=75 second=99 amount=-1 -kerning first=90 second=121 amount=-1 -kerning first=44 second=39 amount=-6 -kerning first=89 second=46 amount=-7 -kerning first=89 second=74 amount=-7 -kerning first=34 second=103 amount=-2 -kerning first=70 second=103 amount=-1 -kerning first=112 second=39 amount=-1 -kerning first=122 second=113 amount=-1 -kerning first=86 second=113 amount=-2 -kerning first=68 second=84 amount=-1 -kerning first=89 second=110 amount=-1 -kerning first=34 second=100 amount=-2 -kerning first=68 second=86 amount=-1 -kerning first=87 second=45 amount=-2 -kerning first=39 second=34 amount=-4 -kerning first=114 second=100 amount=-1 -kerning first=84 second=81 amount=-1 -kerning first=70 second=101 amount=-1 -kerning first=68 second=89 amount=-2 -kerning first=88 second=117 amount=-1 -kerning first=112 second=34 amount=-1 -kerning first=76 second=67 amount=-2 -kerning first=76 second=34 amount=-5 -kerning first=88 second=111 amount=-1 -kerning first=66 second=86 amount=-1 -kerning first=66 second=89 amount=-2 -kerning first=122 second=101 amount=-1 -kerning first=86 second=101 amount=-2 -kerning first=76 second=121 amount=-5 -kerning first=84 second=119 amount=-2 -kerning first=84 second=112 amount=-3 -kerning first=87 second=111 amount=-1 -kerning first=69 second=118 amount=-1 -kerning first=65 second=117 amount=-2 -kerning first=65 second=89 amount=-9 -kerning first=72 second=89 amount=-1 -kerning first=119 second=44 amount=-4 -kerning first=69 second=121 amount=-1 -kerning first=84 second=109 amount=-3 -kerning first=84 second=122 amount=-2 -kerning first=89 second=99 amount=-2 -kerning first=76 second=118 amount=-5 -kerning first=90 second=99 amount=-1 -kerning first=90 second=103 amount=-1 -kerning first=79 second=89 amount=-2 -kerning first=90 second=79 amount=-1 -kerning first=84 second=115 amount=-4 -kerning first=76 second=65 amount=1 -kerning first=90 second=100 amount=-1 -kerning first=118 second=46 amount=-4 -kerning first=87 second=117 amount=-1 -kerning first=118 second=34 amount=1 -kerning first=69 second=103 amount=-1 -kerning first=97 second=121 amount=-1 -kerning first=39 second=111 amount=-2 -kerning first=72 second=88 amount=1 -kerning first=76 second=87 amount=-5 -kerning first=69 second=119 amount=-1 -kerning first=121 second=97 amount=-1 -kerning first=75 second=45 amount=-8 -kerning first=65 second=86 amount=-9 -kerning first=46 second=34 amount=-6 -kerning first=76 second=84 amount=-10 -kerning first=116 second=111 amount=-1 -kerning first=87 second=113 amount=-1 -kerning first=69 second=100 amount=-1 -kerning first=97 second=118 amount=-1 -kerning first=65 second=85 amount=-2 -kerning first=90 second=71 amount=-1 -kerning first=68 second=46 amount=-4 -kerning first=65 second=79 amount=-3 -kerning first=98 second=122 amount=-1 -kerning first=86 second=41 amount=1 -kerning first=84 second=118 amount=-3 -kerning first=70 second=118 amount=-1 -kerning first=121 second=111 amount=-1 -kerning first=81 second=87 amount=-1 -kerning first=70 second=100 amount=-1 -kerning first=102 second=93 amount=1 -kerning first=114 second=101 amount=-1 -kerning first=88 second=45 amount=-2 -kerning first=39 second=103 amount=-2 -kerning first=75 second=103 amount=-1 -kerning first=88 second=101 amount=-1 -kerning first=89 second=103 amount=-2 -kerning first=110 second=39 amount=-1 -kerning first=89 second=89 amount=1 -kerning first=87 second=65 amount=-2 -kerning first=119 second=46 amount=-4 -kerning first=34 second=34 amount=-4 -kerning first=88 second=79 amount=-2 -kerning first=79 second=86 amount=-1 -kerning first=76 second=119 amount=-3 -kerning first=75 second=111 amount=-1 -kerning first=65 second=116 amount=-4 -kerning first=86 second=65 amount=-9 -kerning first=70 second=84 amount=1 -kerning first=75 second=117 amount=-1 -kerning first=80 second=65 amount=-9 -kerning first=34 second=112 amount=-1 -kerning first=102 second=99 amount=-1 -kerning first=118 second=97 amount=-1 -kerning first=89 second=81 amount=-1 -kerning first=118 second=111 amount=-1 -kerning first=102 second=101 amount=-1 -kerning first=114 second=44 amount=-4 -kerning first=90 second=119 amount=-1 -kerning first=75 second=81 amount=-4 -kerning first=88 second=121 amount=-1 -kerning first=34 second=110 amount=-1 -kerning first=86 second=100 amount=-2 -kerning first=122 second=100 amount=-1 -kerning first=89 second=67 amount=-1 -kerning first=90 second=118 amount=-1 -kerning first=84 second=84 amount=1 -kerning first=121 second=34 amount=1 -kerning first=91 second=74 amount=-1 -kerning first=88 second=113 amount=-1 -kerning first=77 second=88 amount=1 -kerning first=75 second=119 amount=-2 -kerning first=114 second=104 amount=-1 -kerning first=68 second=88 amount=-2 -kerning first=121 second=44 amount=-4 -kerning first=81 second=89 amount=-1 -kerning first=102 second=39 amount=1 -kerning first=74 second=65 amount=-2 -kerning first=114 second=118 amount=1 -kerning first=84 second=46 amount=-8 -kerning first=111 second=34 amount=-1 -kerning first=88 second=71 amount=-2 -kerning first=88 second=99 amount=-1 -kerning first=84 second=74 amount=-8 -kerning first=39 second=109 amount=-1 -kerning first=98 second=34 amount=-1 -kerning first=86 second=114 amount=-1 -kerning first=88 second=81 amount=-2 -kerning first=70 second=74 amount=-11 -kerning first=89 second=83 amount=-1 -kerning first=87 second=41 amount=1 -kerning first=89 second=97 amount=-3 -kerning first=89 second=87 amount=1 -kerning first=67 second=125 amount=-1 -kerning first=89 second=93 amount=1 -kerning first=80 second=118 amount=1 -kerning first=107 second=100 amount=-1 -kerning first=114 second=34 amount=1 -kerning first=89 second=109 amount=-1 -kerning first=89 second=45 amount=-2 -kerning first=70 second=44 amount=-8 -kerning first=34 second=39 amount=-4 -kerning first=88 second=67 amount=-2 -kerning first=70 second=46 amount=-8 -kerning first=102 second=41 amount=1 -kerning first=89 second=117 amount=-1 -kerning first=89 second=111 amount=-4 -kerning first=89 second=115 amount=-4 -kerning first=114 second=102 amount=1 -kerning first=89 second=125 amount=1 -kerning first=89 second=121 amount=-1 -kerning first=114 second=108 amount=-1 -kerning first=47 second=47 amount=-8 -kerning first=65 second=63 amount=-2 -kerning first=75 second=67 amount=-4 -kerning first=87 second=100 amount=-1 -kerning first=111 second=104 amount=-1 -kerning first=111 second=107 amount=-1 -kerning first=75 second=109 amount=-1 -kerning first=87 second=114 amount=-1 -kerning first=111 second=120 amount=-1 -kerning first=69 second=99 amount=-1 -kerning first=65 second=84 amount=-6 -kerning first=39 second=97 amount=-2 -kerning first=121 second=46 amount=-4 -kerning first=89 second=85 amount=-3 -kerning first=75 second=79 amount=-4 -kerning first=107 second=99 amount=-1 -kerning first=102 second=100 amount=-1 -kerning first=102 second=103 amount=-1 -kerning first=75 second=110 amount=-1 -kerning first=39 second=110 amount=-1 -kerning first=69 second=84 amount=1 -kerning first=84 second=111 amount=-3 -kerning first=120 second=111 amount=-1 -kerning first=84 second=114 amount=-3 -kerning first=112 second=120 amount=-1 -kerning first=79 second=84 amount=-1 -kerning first=84 second=117 amount=-3 -kerning first=89 second=79 amount=-1 -kerning first=75 second=113 amount=-1 -kerning first=39 second=113 amount=-2 -kerning first=80 second=44 amount=-11 -kerning first=79 second=88 amount=-2 -kerning first=98 second=39 amount=-1 -kerning first=65 second=118 amount=-4 -kerning first=65 second=34 amount=-4 -kerning first=88 second=103 amount=-1 -kerning first=77 second=89 amount=-1 -kerning first=39 second=101 amount=-2 -kerning first=75 second=101 amount=-1 -kerning first=88 second=100 amount=-1 -kerning first=78 second=65 amount=-3 -kerning first=87 second=44 amount=-4 -kerning first=67 second=41 amount=-1 -kerning first=86 second=93 amount=1 -kerning first=84 second=83 amount=-1 -kerning first=102 second=113 amount=-1 -kerning first=34 second=111 amount=-2 -kerning first=70 second=111 amount=-1 -kerning first=86 second=99 amount=-2 -kerning first=84 second=86 amount=1 -kerning first=122 second=99 amount=-1 -kerning first=84 second=89 amount=1 -kerning first=70 second=114 amount=-1 -kerning first=86 second=74 amount=-8 -kerning first=89 second=38 amount=-1 -kerning first=87 second=97 amount=-1 -kerning first=76 second=86 amount=-9 -kerning first=40 second=86 amount=1 -kerning first=90 second=113 amount=-1 -kerning first=39 second=39 amount=-4 -kerning first=111 second=39 amount=-1 -kerning first=90 second=117 amount=-1 -kerning first=89 second=41 amount=1 -kerning first=65 second=121 amount=-4 -kerning first=89 second=100 amount=-2 -kerning first=89 second=42 amount=-2 -kerning first=76 second=117 amount=-2 -kerning first=69 second=111 amount=-1 -kerning first=46 second=39 amount=-6 -kerning first=118 second=39 amount=1 -kerning first=91 second=85 amount=-1 -kerning first=80 second=90 amount=-1 -kerning first=90 second=81 amount=-1 -kerning first=69 second=117 amount=-1 -kerning first=76 second=39 amount=-5 -kerning first=90 second=67 amount=-1 -kerning first=87 second=103 amount=-1 -kerning first=84 second=120 amount=-3 -kerning first=89 second=101 amount=-2 -kerning first=102 second=125 amount=1 -kerning first=76 second=85 amount=-2 -kerning first=79 second=65 amount=-3 -kerning first=65 second=71 amount=-3 -kerning first=79 second=44 amount=-4 -kerning first=97 second=39 amount=-2 -kerning first=90 second=101 amount=-1 -kerning first=65 second=87 amount=-5 -kerning first=79 second=46 amount=-4 -kerning first=87 second=99 amount=-1 -kerning first=34 second=101 amount=-2 -kerning first=40 second=89 amount=1 -kerning first=76 second=89 amount=-8 -kerning first=69 second=113 amount=-1 -kerning first=120 second=103 amount=-1 -kerning first=69 second=101 amount=-1 -kerning first=69 second=102 amount=-1 -kerning first=104 second=39 amount=-1 -kerning first=80 second=121 amount=1 -kerning first=86 second=46 amount=-8 -kerning first=65 second=81 amount=-3 -kerning first=86 second=44 amount=-8 -kerning first=120 second=99 amount=-1 -kerning first=98 second=120 amount=-1 -kerning first=39 second=115 amount=-3 -kerning first=121 second=39 amount=1 -kerning first=88 second=118 amount=-1 -kerning first=84 second=65 amount=-6 -kerning first=65 second=39 amount=-4 -kerning first=84 second=79 amount=-1 -kerning first=65 second=119 amount=-4 -kerning first=70 second=117 amount=-1 -kerning first=75 second=100 amount=-1 -kerning first=86 second=111 amount=-2 -kerning first=122 second=111 amount=-1 -kerning first=81 second=84 amount=-2 -kerning first=107 second=103 amount=-1 -kerning first=118 second=44 amount=-4 -kerning first=87 second=46 amount=-4 -kerning first=87 second=101 amount=-1 -kerning first=70 second=79 amount=-2 -kerning first=87 second=74 amount=-2 -kerning first=123 second=74 amount=-1 -kerning first=76 second=71 amount=-2 -kerning first=39 second=100 amount=-2 -kerning first=80 second=88 amount=-1 -kerning first=84 second=121 amount=-3 -kerning first=112 second=122 amount=-1 -kerning first=84 second=71 amount=-1 -kerning first=89 second=86 amount=1 -kerning first=84 second=113 amount=-3 -kerning first=120 second=113 amount=-1 -kerning first=89 second=44 amount=-7 -kerning first=84 second=99 amount=-3 -kerning first=34 second=113 amount=-2 -kerning first=80 second=46 amount=-11 -kerning first=86 second=117 amount=-1 -kerning first=110 second=34 amount=-1 -kerning first=80 second=74 amount=-7 -kerning first=120 second=101 amount=-1 -kerning first=73 second=88 amount=1 -kerning first=108 second=111 amount=-1 -kerning first=34 second=115 amount=-3 -kerning first=89 second=113 amount=-2 -kerning first=82 second=86 amount=-3 -kerning first=114 second=39 amount=1 -kerning first=34 second=109 amount=-1 -kerning first=84 second=101 amount=-3 -kerning first=70 second=121 amount=-1 -kerning first=123 second=85 amount=-1 -kerning first=122 second=103 amount=-1 -kerning first=86 second=97 amount=-2 -kerning first=82 second=89 amount=-4 -kerning first=66 second=84 amount=-1 -kerning first=84 second=97 amount=-4 -kerning first=86 second=103 amount=-2 -kerning first=70 second=113 amount=-1 -kerning first=84 second=87 amount=1 -kerning first=75 second=112 amount=-1 -kerning first=114 second=111 amount=-1 -kerning first=39 second=112 amount=-1 -kerning first=107 second=101 amount=-1 -kerning first=82 second=84 amount=-3 -kerning first=114 second=121 amount=1 -kerning first=34 second=99 amount=-2 -kerning first=70 second=81 amount=-2 -kerning first=111 second=122 amount=-1 -kerning first=84 second=67 amount=-1 -kerning first=111 second=108 amount=-1 -kerning first=89 second=84 amount=1 -kerning first=76 second=79 amount=-2 -kerning first=85 second=65 amount=-2 -kerning first=44 second=34 amount=-6 -kerning first=65 second=67 amount=-3 -kerning first=109 second=34 amount=-1 -kerning first=114 second=103 amount=-1 -kerning first=78 second=89 amount=-1 -kerning first=89 second=114 amount=-1 -kerning first=89 second=112 amount=-1 -kerning first=34 second=65 amount=-4 -kerning first=70 second=65 amount=-11 -kerning first=81 second=86 amount=-1 -kerning first=114 second=119 amount=1 -kerning first=89 second=102 amount=-1 -kerning first=84 second=45 amount=-8 -kerning first=86 second=125 amount=1 -kerning first=70 second=67 amount=-2 -kerning first=89 second=116 amount=-1 -kerning first=102 second=34 amount=1 -kerning first=114 second=99 amount=-1 -kerning first=67 second=84 amount=-1 -kerning first=114 second=113 amount=-1 -kerning first=89 second=122 amount=-1 -kerning first=89 second=118 amount=-1 -kerning first=70 second=71 amount=-2 -kerning first=114 second=107 amount=-1 -kerning first=89 second=120 amount=-1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/web/static/sitemap.mjs b/src/web/static/sitemap.mjs index b96047fc..d39fd540 100644 --- a/src/web/static/sitemap.mjs +++ b/src/web/static/sitemap.mjs @@ -1,5 +1,5 @@ import sm from "sitemap"; -import OperationConfig from "../../core/config/OperationConfig.json" assert {type: "json"}; +import OperationConfig from "../../core/config/OperationConfig.json" with { type: "json" }; /** @@ -10,25 +10,25 @@ import OperationConfig from "../../core/config/OperationConfig.json" assert {typ * @license Apache-2.0 */ -const smStream = new sm.SitemapStream({ - hostname: "https://gchq.github.io/CyberChef", -}); +const baseUrl = "https://gchq.github.io/CyberChef/"; + +const smStream = new sm.SitemapStream({}); smStream.write({ - url: "/", + url: baseUrl, changefreq: "weekly", - priority: 1.0 + priority: 1.0, }); for (const op in OperationConfig) { smStream.write({ - url: `/?op=${encodeURIComponent(op)}`, + url: `${baseUrl}?op=${encodeURIComponent(op)}`, changeFreq: "yearly", - priority: 0.5 + priority: 0.5, }); } smStream.end(); sm.streamToPromise(smStream).then( - buffer => console.log(buffer.toString()) // eslint-disable-line no-console + (buffer) => console.log(buffer.toString()), // eslint-disable-line no-console ); diff --git a/src/web/waiters/InputWaiter.mjs b/src/web/waiters/InputWaiter.mjs index d32ed9d1..94663a0b 100644 --- a/src/web/waiters/InputWaiter.mjs +++ b/src/web/waiters/InputWaiter.mjs @@ -151,8 +151,26 @@ class InputWaiter { // Event handlers EditorView.domEventHandlers({ paste(event, view) { + const clipboardData = event.clipboardData; + const items = clipboardData.items; + let files = []; + for (let i = 0; i < items.length; i++) { + const item = items[i]; + if (item.kind === "string") { + // If there are any string items they should be preferred over + // files. + files = []; + break; + } else if (item.kind === "file") { + files.push(item.getAsFile()); + } + } + if (files.length > 0) { + // Prevent the default paste behavior, afterPaste will load the files instead + event.preventDefault(); + } setTimeout(() => { - self.afterPaste(event); + self.afterPaste(files); }); } }) @@ -914,9 +932,12 @@ class InputWaiter { * Handler that fires just after input paste events. * Checks whether the EOL separator or character encoding should be updated. * - * @param {event} e + * @param {File[]} files - An array of any files that were included in the paste event */ - afterPaste(e) { + afterPaste(files) { + if (files.length > 0) { + this.loadUIFiles(files); + } // If EOL has been fixed, skip this. if (this.eolState > 1) return; diff --git a/src/web/workers/DishWorker.mjs b/src/web/workers/DishWorker.mjs index 4bfb701f..662f3ffc 100644 --- a/src/web/workers/DishWorker.mjs +++ b/src/web/workers/DishWorker.mjs @@ -7,6 +7,8 @@ */ import Dish from "../../core/Dish.mjs"; +import DishError from "../../core/errors/DishError.mjs"; +import { CHR_ENC_SIMPLE_REVERSE_LOOKUP } from "../../core/lib/ChrEnc.mjs"; import Utils from "../../core/Utils.mjs"; import cptable from "codepage"; import loglevelMessagePrefix from "loglevel-message-prefix"; @@ -98,7 +100,7 @@ async function bufferToStr(data) { try { str = cptable.utils.decode(data.encoding, new Uint8Array(data.buffer)); } catch (err) { - str = err; + str = new DishError(`Error decoding buffer with encoding ${CHR_ENC_SIMPLE_REVERSE_LOOKUP[data.encoding]}: ${err.message}`).toString(); } } diff --git a/tests/browser/02_ops.js b/tests/browser/02_ops.js index 7fe7f538..d0b89c3e 100644 --- a/tests/browser/02_ops.js +++ b/tests/browser/02_ops.js @@ -34,7 +34,14 @@ module.exports = { testOp(browser, "AES Encrypt", "test input", "e42eb8fbfb7a98fff061cd2c1a794d92", [{"option": "Hex", "string": "00112233445566778899aabbccddeeff"}, {"option": "Hex", "string": "00000000000000000000000000000000"}, "CBC", "Raw", "Hex"]); testOp(browser, "AND", "test input", "4$04 $044", [{ "option": "Hex", "string": "34" }]); testOp(browser, "Add line numbers", "test input", "1 test input"); - testOp(browser, ["From Hex", "Add Text To Image", "To Base64"], Images.PNG_HEX, Images.PNG_CHEF_B64, [[], ["Chef", "Center", "Middle", 0, 0, 16], []]); + testOp(browser, ["From Hex", "Add Text To Image", "SHA2"], Images.PNG_HEX, "50cdf8ea483c55564a091650c2bccb4586f919b721e5fe9d6a61660505b4346d6ebdb2ef0cf075a7728cd84cb26ea3e477b5bd86a94a49a27d79423994afb60a", [[], ["Chef", "Center", "Middle", 0, 0, 16, "Roboto"], []]); + testOp(browser, ["From Hex", "Add Text To Image", "SHA2"], Images.PNG_HEX, "78b3055463d9167dd039e47f451acaf06c593d209f8e405b4e18011cdcf190dc0af5952be887d93c0ebd38738e978120c1294c71104e6b00d3f9de8d6320ec1c", [[], ["Chef", "Center", "Middle", 0, 0, 16, "Roboto Black"], []]); + testOp(browser, ["From Hex", "Add Text To Image", "SHA2"], Images.PNG_HEX, "4ab4d4b6cb22ad700f6cd144c2c8ecad2a094f21a1d1d5d48eb6c8f97417192f89b4512f6a78276d49668ebef5e89c3a4d14860cb79399a0dafce98c92209e07", [[], ["Chef", "Center", "Middle", 0, 0, 16, "Roboto Mono"], []]); + testOp(browser, ["From Hex", "Add Text To Image", "SHA2"], Images.PNG_HEX, "11490db4907516b4d9e256da1ac0b02b561fa7547971e6316a8a0b90c9c66585a11f3145672c6d972b1a221d3bfad9c8a97de7ff77fd9442ebc40f39c1ef9ef7", [[], ["Chef", "Center", "Middle", 0, 0, 16, "Roboto Slab"], []]); + testOp(browser, ["From Hex", "Dither Image", "SHA2"], Images.PNG_HEX, "cbf587a78915cfb14546ba83080b13e5054800802488dd0cb786b8951e7dc0b48f055260917bd0ccfc075e422b9d6aff112948562653995d74e70f0b66367ac3", [[], [], []]); + testOp(browser, ["From Hex", "Generate Image", "SHA2"], Images.PNG_HEX, "2c451762a6c9192fd31dc80765eab3f447be70ea51f6fdb6911ade4d89d4a98bd0a1ff00b08d76aac472faeceb54b66092e3f3be7bbf899bf3e55ca9c96a56aa", [[], [], []]); + testOp(browser, ["From Hex", "Image Hue/Saturation/Lightness", "SHA2"], Images.PNG_HEX, "522dfc0bbef00e05c5d6861a002039fa2952e4bbb7fe8d21d0d538ef6f9d65da82065929b4150dc5b8b49460ee6c9bef7f660b86f8d4e7442a07c61c0a152a4b", [[], [50, 50, 50], []]); + testOp(browser, ["From Hex", "Resize Image", "SHA2"], Images.PNG_HEX, "654bfbf0a0537c901459c4bc22c5fb0bacbf01af775a0733e3a1c46cda5b699bcc4ed85322d813c7bb9b245d62d64425c0766fe03d3d20bc63634e2a4df17626", [[], [64, 64], []]); testOp(browser, "Adler-32 Checksum", "test input", "16160411"); testOp(browser, "Affine Cipher Decode", "test input", "rcqr glnsr", [1, 2]); testOp(browser, "Affine Cipher Encode", "test input", "gndg zoujg", [3, 1]); @@ -58,7 +65,10 @@ module.exports = { testOp(browser, "Bit shift right", "test input", ":29:\u0010478::"); testOp(browser, "Blowfish Decrypt", "10884e15427dd84ec35204e9c8e921ae", "test_output", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Hex", "Raw"]); testOp(browser, "Blowfish Encrypt", "test input", "f0fadbd1d90d774f714248cf26b96410", [{"option": "Hex", "string": "1234567801234567"}, {"option": "Hex", "string": "0011223344556677"}, "CBC", "Raw", "Hex"]); - testOp(browser, ["From Hex", "Blur Image", "To Base64"], Images.PNG_HEX, Images.PNG_BLUR_B64); + testOp(browser, ["From Hex", "Blur Image", "SHA2"], Images.PNG_HEX, "24f2e89f3e00cc35f551bbc48ea82e76474946ce0282183494d1ca3d3b0012c27b6102c4368ae056dc7fecb6df7886d86ff3d29b7e5965493f30c371eee9a24e"); + testOp(browser, ["From Hex", "Blur Image", "SHA2"], Images.PNG_HEX, "2c49d89fc10c94352c9a19f82de353c37928831d6f976a6b36eb918825a0ba027980801838228a4a0da63f1886e4fa59b6666f992ad2d2b7d4622253dc034052", [[], [5, "Gaussian"], []]); + testOp(browser, ["From Hex", "Sharpen Image", "SHA2"], Images.PNG_HEX, "acc7027642c2eeb67d7356a80ed8a1bdce9adabf656ea1294e47723f506626a7aa41f1660fa844a1e1e83b17180017ab0d5bccd7f6a341692832020dc887eaa5"); + testOp(browser, ["From Hex", "Contain Image", "SHA2"], Images.PNG_HEX, "cb871ad0722d487d56a2b18247b1aa30ecc244eb717e08e23a55cae78759553312dc1717196d7cb9daa04743e57c56fc3901ba92be5a68fb03c377f718e8efe7"); testOpHtml(browser, "Bombe", "XTSYN WAEUG EZALY NRQIM AMLZX MFUOD AWXLY LZCUZ QOQBQ JLCPK NDDRW F", "table tr:last-child td:first-child", "ECG", ["3-rotor", "LEYJVCNIXWPBQMDRTAKZGFUHOS", "BDFHJLCPRTXVZNYEIWGAKMUSQO { + assert.equal( + Utils.printable("\x7e\x7f\x80\xa7", false, true), + "\x7e...", + ); + }), ]); diff --git a/tests/node/tests/nodeApi.mjs b/tests/node/tests/nodeApi.mjs index 29a47ffc..92d4d991 100644 --- a/tests/node/tests/nodeApi.mjs +++ b/tests/node/tests/nodeApi.mjs @@ -345,6 +345,42 @@ TestRegister.addApiTests([ assert.strictEqual(result.toString(), "begin_something_aaaaaaaaaaaaaa_end_something"); }), + it("chef.bake: should accept operation names from Chef Website which contain forward slash", () => { + const result = chef.bake("I'll have the test salmon", [ + { "op": "Find / Replace", + "args": [{ "option": "Regex", "string": "test" }, "good", true, false, true, false]} + ]); + assert.strictEqual(result.toString(), "I'll have the good salmon"); + }), + + it("chef.bake: should accept operation names from Chef Website which contain a hyphen", () => { + const result = chef.bake("I'll have the test salmon", [ + { "op": "Adler-32 Checksum", + "args": [] } + ]); + assert.strictEqual(result.toString(), "6e4208f8"); + }), + + it("chef.bake: should accept operation names from Chef Website which contain a period", () => { + const result = chef.bake("30 13 02 01 05 16 0e 41 6e 79 62 6f 64 79 20 74 68 65 72 65 3f", [ + { "op": "Parse ASN.1 hex string", + "args": [0, 32] } + ]); + assert.strictEqual(result.toString(), `SEQUENCE + INTEGER 05 + IA5String 'Anybody there?' +`); + }), + + it("Excluded operations: throw a sensible error when you try and call one", () => { + try { + chef.fork(); + } catch (e) { + assert.strictEqual(e.type, "ExcludedOperationError"); + assert.strictEqual(e.message, "Sorry, the Fork operation is not available in the Node.js version of CyberChef."); + } + }), + it("chef.bake: cannot accept flowControl operations in recipe", () => { assert.throws(() => chef.bake("some input", "magic"), { name: "TypeError", diff --git a/tests/operations/index.mjs b/tests/operations/index.mjs index f147e9e7..9fccd051 100644 --- a/tests/operations/index.mjs +++ b/tests/operations/index.mjs @@ -26,6 +26,7 @@ import "./tests/Base64.mjs"; import "./tests/Base85.mjs"; import "./tests/Base92.mjs"; import "./tests/BCD.mjs"; +import "./tests/Bech32.mjs"; import "./tests/BitwiseOp.mjs"; import "./tests/BLAKE2b.mjs"; import "./tests/BLAKE2s.mjs"; @@ -75,6 +76,7 @@ import "./tests/FromDecimal.mjs"; import "./tests/GenerateAllChecksums.mjs"; import "./tests/GenerateAllHashes.mjs"; import "./tests/GenerateDeBruijnSequence.mjs"; +import "./tests/GenerateQRCode.mjs"; import "./tests/GetAllCasings.mjs"; import "./tests/GOST.mjs"; import "./tests/Gunzip.mjs"; diff --git a/tests/operations/tests/Bech32.mjs b/tests/operations/tests/Bech32.mjs new file mode 100644 index 00000000..85325d47 --- /dev/null +++ b/tests/operations/tests/Bech32.mjs @@ -0,0 +1,702 @@ +/** + * Bech32 tests. + * + * Test vectors from official BIP specifications: + * BIP-0173: https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki + * BIP-0350: https://github.com/bitcoin/bips/blob/master/bip-0350.mediawiki + * + * AGE key test vectors from: + * https://asecuritysite.com/age/go_age5 + * + * @author Medjedtxm + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ + +import TestRegister from "../../lib/TestRegister.mjs"; + +TestRegister.addTests([ + // ============= To Bech32 Tests ============= + { + name: "To Bech32: empty input", + input: "", + expectedOutput: "bc1gmk9yu", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["bc", "Bech32", "Raw bytes", "Generic", 0] + } + ], + }, + { + name: "To Bech32: single byte", + input: "A", + expectedOutput: "bc1gyufle22", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["bc", "Bech32", "Raw bytes", "Generic", 0] + } + ], + }, + { + name: "To Bech32: Hello", + input: "Hello", + expectedOutput: "bc1fpjkcmr0gzsgcg", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["bc", "Bech32", "Raw bytes", "Generic", 0] + } + ], + }, + { + name: "To Bech32: custom HRP", + input: "test", + expectedOutput: "custom1w3jhxaq593qur", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["custom", "Bech32", "Raw bytes", "Generic", 0] + } + ], + }, + { + name: "To Bech32: testnet HRP", + input: "data", + expectedOutput: "tb1v3shgcg3x07jr", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["tb", "Bech32", "Raw bytes", "Generic", 0] + } + ], + }, + { + name: "To Bech32m: empty input", + input: "", + expectedOutput: "bc1a8xfp7", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["bc", "Bech32m", "Raw bytes", "Generic", 0] + } + ], + }, + { + name: "To Bech32m: single byte", + input: "A", + expectedOutput: "bc1gyf4040g", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["bc", "Bech32m", "Raw bytes", "Generic", 0] + } + ], + }, + { + name: "To Bech32m: Hello", + input: "Hello", + expectedOutput: "bc1fpjkcmr0a7qya2", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["bc", "Bech32m", "Raw bytes", "Generic", 0] + } + ], + }, + { + name: "To Bech32: empty HRP error", + input: "test", + expectedOutput: "Human-Readable Part (HRP) cannot be empty.", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["", "Bech32", "Raw bytes", "Generic", 0] + } + ], + }, + + // ============= From Bech32 Tests (Raw output) ============= + { + name: "From Bech32: decode single byte (Raw)", + input: "bc1gyufle22", + expectedOutput: "A", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "Raw"] + } + ], + }, + { + name: "From Bech32: decode Hello (Raw)", + input: "bc1fpjkcmr0gzsgcg", + expectedOutput: "Hello", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "Raw"] + } + ], + }, + { + name: "From Bech32: auto-detect Bech32 (Raw)", + input: "bc1fpjkcmr0gzsgcg", + expectedOutput: "Hello", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Raw"] + } + ], + }, + { + name: "From Bech32m: decode Hello (Raw)", + input: "bc1fpjkcmr0a7qya2", + expectedOutput: "Hello", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32m", "Raw"] + } + ], + }, + { + name: "From Bech32: auto-detect Bech32m (Raw)", + input: "bc1fpjkcmr0a7qya2", + expectedOutput: "Hello", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Raw"] + } + ], + }, + { + name: "From Bech32: uppercase input (Raw)", + input: "BC1FPJKCMR0GZSGCG", + expectedOutput: "Hello", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Raw"] + } + ], + }, + { + name: "From Bech32: custom HRP (Raw)", + input: "custom1w3jhxaq593qur", + expectedOutput: "test", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "Raw"] + } + ], + }, + { + name: "From Bech32: empty input", + input: "", + expectedOutput: "", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Hex"] + } + ], + }, + { + name: "From Bech32: empty data part (Hex)", + input: "bc1gmk9yu", + expectedOutput: "", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "Hex"] + } + ], + }, + + // ============= From Bech32 HRP Output Tests ============= + { + name: "From Bech32: HRP: Hex output format", + input: "bc1fpjkcmr0gzsgcg", + expectedOutput: "bc: 48656c6c6f", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "HRP: Hex"] + } + ], + }, + { + name: "From Bech32: JSON output format", + input: "bc1fpjkcmr0gzsgcg", + expectedOutput: "{\n \"hrp\": \"bc\",\n \"encoding\": \"Bech32\",\n \"data\": \"48656c6c6f\"\n}", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "JSON"] + } + ], + }, + { + name: "From Bech32: Hex output format", + input: "bc1fpjkcmr0gzsgcg", + expectedOutput: "48656c6c6f", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "Hex"] + } + ], + }, + + // ============= AGE Key Test Vectors ============= + // From: https://asecuritysite.com/age/go_age5 + { + name: "From Bech32: AGE public key 1 (HRP: Hex)", + input: "age1kk86t4lr4s9uwvnqjzp2e35rflvcpnjt33q99547ct23xzk0ssss3ma49j", + expectedOutput: "age: b58fa5d7e3ac0bc732609082acc6834fd980ce4b8c4052d2bec2d5130acf8421", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "HRP: Hex"] + } + ], + }, + { + name: "From Bech32: AGE private key 1 (HRP: Hex)", + input: "AGE-SECRET-KEY-1Z5N23X54Y4E9NLMPNH6EZDQQX9V883TMKJ3ZJF5QXXMKNZ2RPFXQUQF74G", + expectedOutput: "age-secret-key-: 1526a89a95257259ff619df5913400315873c57bb4a229268031b76989430a4c", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "HRP: Hex"] + } + ], + }, + { + name: "From Bech32: AGE public key 2 (HRP: Hex)", + input: "age1nwt7gkq7udvalagqn7l8a4jgju7wtenkg925pvuqvn7cfcry6u2qkae4ad", + expectedOutput: "age: 9b97e4581ee359dff5009fbe7ed648973ce5e676415540b38064fd84e064d714", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "HRP: Hex"] + } + ], + }, + { + name: "From Bech32: AGE private key 2 (HRP: Hex)", + input: "AGE-SECRET-KEY-137M0YVE3CL6M8C4ET9L2KU67FPQHJZTW547QD5CK0R5A5T09ZGJSQGR9LX", + expectedOutput: "age-secret-key-: 8fb6f23331c7f5b3e2b9597eab735e484179096ea57c06d31678e9da2de51225", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "HRP: Hex"] + } + ], + }, + { + name: "From Bech32: AGE public key 1 (JSON)", + input: "age1kk86t4lr4s9uwvnqjzp2e35rflvcpnjt33q99547ct23xzk0ssss3ma49j", + expectedOutput: "{\n \"hrp\": \"age\",\n \"encoding\": \"Bech32\",\n \"data\": \"b58fa5d7e3ac0bc732609082acc6834fd980ce4b8c4052d2bec2d5130acf8421\"\n}", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "JSON"] + } + ], + }, + + // ============= Error Cases ============= + { + name: "From Bech32: mixed case error", + input: "bc1FpjKcmr0gzsgcg", + expectedOutput: "Invalid Bech32 string: mixed case is not allowed. Use all uppercase or all lowercase.", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Hex"] + } + ], + }, + { + name: "From Bech32: no separator error", + input: "noseparator", + expectedOutput: "Invalid Bech32 string: no separator '1' found.", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Hex"] + } + ], + }, + { + name: "From Bech32: empty HRP error", + input: "1qqqqqqqqqqqqqqqq", + expectedOutput: "Invalid Bech32 string: Human-Readable Part (HRP) cannot be empty.", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Hex"] + } + ], + }, + { + name: "From Bech32: invalid checksum", + input: "bc1fpjkcmr0gzsgcx", + expectedOutput: "Invalid Bech32/Bech32m string: checksum verification failed.", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Hex"] + } + ], + }, + { + name: "From Bech32: data too short", + input: "bc1abc", + expectedOutput: "Invalid Bech32 string: data part is too short (minimum 6 characters for checksum).", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Hex"] + } + ], + }, + { + name: "From Bech32: wrong encoding specified", + input: "bc1fpjkcmr0gzsgcg", + expectedOutput: "Invalid Bech32m checksum.", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32m", "Hex"] + } + ], + }, + + // ============= BIP-0173 Test Vectors (Bech32) ============= + { + name: "From Bech32: BIP-0173 A12UEL5L (empty data)", + input: "A12UEL5L", + expectedOutput: "", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "Hex"] + } + ], + }, + { + name: "From Bech32: BIP-0173 a12uel5l lowercase", + input: "a12uel5l", + expectedOutput: "", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "Hex"] + } + ], + }, + { + name: "From Bech32: BIP-0173 long HRP with bio", + input: "an83characterlonghumanreadablepartthatcontainsthenumber1andtheexcludedcharactersbio1tt5tgs", + expectedOutput: "", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "Hex"] + } + ], + }, + { + name: "From Bech32: BIP-0173 abcdef with data", + input: "abcdef1qpzry9x8gf2tvdw0s3jn54khce6mua7lmqqqxw", + expectedOutput: "abcdef: 00443214c74254b635cf84653a56d7c675be77df", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "HRP: Hex"] + } + ], + }, + { + name: "From Bech32: BIP-0173 split HRP", + input: "split1checkupstagehandshakeupstreamerranterredcaperred2y9e3w", + expectedOutput: "split: c5f38b70305f519bf66d85fb6cf03058f3dde463ecd7918f2dc743918f2d", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "HRP: Hex"] + } + ], + }, + { + name: "From Bech32: BIP-0173 question mark HRP", + input: "?1ezyfcl", + expectedOutput: "", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32", "Hex"] + } + ], + }, + + // ============= BIP-0350 Test Vectors (Bech32m) ============= + { + name: "From Bech32m: BIP-0350 A1LQFN3A (empty data)", + input: "A1LQFN3A", + expectedOutput: "", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32m", "Hex"] + } + ], + }, + { + name: "From Bech32m: BIP-0350 a1lqfn3a lowercase", + input: "a1lqfn3a", + expectedOutput: "", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32m", "Hex"] + } + ], + }, + { + name: "From Bech32m: BIP-0350 long HRP", + input: "an83characterlonghumanreadablepartthatcontainsthetheexcludedcharactersbioandnumber11sg7hg6", + expectedOutput: "", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32m", "Hex"] + } + ], + }, + { + name: "From Bech32m: BIP-0350 abcdef with data", + input: "abcdef1l7aum6echk45nj3s0wdvt2fg8x9yrzpqzd3ryx", + expectedOutput: "abcdef: ffbbcdeb38bdab49ca307b9ac5a928398a418820", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32m", "HRP: Hex"] + } + ], + }, + { + name: "From Bech32m: BIP-0350 split HRP", + input: "split1checkupstagehandshakeupstreamerranterredcaperredlc445v", + expectedOutput: "split: c5f38b70305f519bf66d85fb6cf03058f3dde463ecd7918f2dc743918f2d", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32m", "HRP: Hex"] + } + ], + }, + { + name: "From Bech32m: BIP-0350 question mark HRP", + input: "?1v759aa", + expectedOutput: "", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Bech32m", "Hex"] + } + ], + }, + + // ============= Bitcoin scriptPubKey Output Format Tests ============= + // Test vectors from BIP-0173 and BIP-0350 + { + name: "From Bech32: Bitcoin scriptPubKey v0 P2WPKH", + input: "BC1QW508D6QEJXTDG4Y5R3ZARVARY0C5XW7KV8F3T4", + expectedOutput: "0014751e76e8199196d454941c45d1b3a323f1433bd6", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Bitcoin scriptPubKey"] + } + ], + }, + { + name: "From Bech32: Bitcoin scriptPubKey v0 P2WSH", + input: "tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7", + expectedOutput: "00201863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Bitcoin scriptPubKey"] + } + ], + }, + { + name: "From Bech32: Bitcoin scriptPubKey v1 Taproot (Bech32m)", + input: "bc1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqzk5jj0", + expectedOutput: "512079be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Bitcoin scriptPubKey"] + } + ], + }, + { + name: "From Bech32: Bitcoin scriptPubKey v16", + input: "BC1SW50QGDZ25J", + expectedOutput: "6002751e", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Bitcoin scriptPubKey"] + } + ], + }, + { + name: "From Bech32: Bitcoin scriptPubKey v2", + input: "bc1zw508d6qejxtdg4y5r3zarvaryvaxxpcs", + expectedOutput: "5210751e76e8199196d454941c45d1b3a323", + recipeConfig: [ + { + "op": "From Bech32", + "args": ["Auto-detect", "Bitcoin scriptPubKey"] + } + ], + }, + + // ============= Bitcoin SegWit Encoding Tests ============= + { + name: "To Bech32: Bitcoin SegWit v0 P2WPKH", + input: "751e76e8199196d454941c45d1b3a323f1433bd6", + expectedOutput: "bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["bc", "Bech32", "Hex", "Bitcoin SegWit", 0] + } + ], + }, + { + name: "To Bech32: Bitcoin SegWit v0 P2WSH testnet", + input: "1863143c14c5166804bd19203356da136c985678cd4d27a1b8c6329604903262", + expectedOutput: "tb1qrp33g0q5c5txsp9arysrx4k6zdkfs4nce4xj0gdcccefvpysxf3q0sl5k7", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["tb", "Bech32", "Hex", "Bitcoin SegWit", 0] + } + ], + }, + { + name: "To Bech32m: Bitcoin Taproot v1", + input: "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798", + expectedOutput: "bc1p0xlxvlhemja6c4dqv22uapctqupfhlxm9h8z3k2e72q4k9hcz7vqzk5jj0", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["bc", "Bech32m", "Hex", "Bitcoin SegWit", 1] + } + ], + }, + { + name: "To Bech32m: Bitcoin SegWit v16", + input: "751e", + expectedOutput: "bc1sw50qgdz25j", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["bc", "Bech32m", "Hex", "Bitcoin SegWit", 16] + } + ], + }, + + // ============= Round-trip Tests ============= + { + name: "Bech32: encode then decode round-trip", + input: "The quick brown fox jumps over the lazy dog", + expectedOutput: "The quick brown fox jumps over the lazy dog", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["test", "Bech32", "Raw bytes", "Generic", 0] + }, + { + "op": "From Bech32", + "args": ["Bech32", "Raw"] + } + ], + }, + { + name: "Bech32m: encode then decode round-trip", + input: "The quick brown fox jumps over the lazy dog", + expectedOutput: "The quick brown fox jumps over the lazy dog", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["test", "Bech32m", "Raw bytes", "Generic", 0] + }, + { + "op": "From Bech32", + "args": ["Bech32m", "Raw"] + } + ], + }, + { + name: "Bech32: binary data round-trip", + input: "0001020304050607", + expectedOutput: "0001020304050607", + recipeConfig: [ + { + "op": "From Hex", + "args": ["Auto"] + }, + { + "op": "To Bech32", + "args": ["bc", "Bech32", "Raw bytes", "Generic", 0] + }, + { + "op": "From Bech32", + "args": ["Bech32", "Hex"] + } + ], + }, + { + name: "Bech32: auto-detect round-trip", + input: "CyberChef Bech32 Test", + expectedOutput: "CyberChef Bech32 Test", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["cyberchef", "Bech32", "Raw bytes", "Generic", 0] + }, + { + "op": "From Bech32", + "args": ["Auto-detect", "Raw"] + } + ], + }, + { + name: "Bech32m: auto-detect round-trip", + input: "CyberChef Bech32m Test", + expectedOutput: "CyberChef Bech32m Test", + recipeConfig: [ + { + "op": "To Bech32", + "args": ["cyberchef", "Bech32m", "Raw bytes", "Generic", 0] + }, + { + "op": "From Bech32", + "args": ["Auto-detect", "Raw"] + } + ], + }, +]); diff --git a/tests/operations/tests/Code.mjs b/tests/operations/tests/Code.mjs index c62c7630..65c52935 100644 --- a/tests/operations/tests/Code.mjs +++ b/tests/operations/tests/Code.mjs @@ -322,8 +322,21 @@ TestRegister.addTests([ ] } ], - expectedMatch: /^Invalid JPath expression: jsonPath: self is not defined:/ + expectedMatch: /^Invalid JPath expression: Unexpected "\{" at character 1/ }, + { + name: "JPath Expression: Script-based RCE", + input: "[{}]", + recipeConfig: [ + { + "op": "JPath expression", + "args": [ + "$..[?(p=\"console.log(this.process.mainModule.require('child_process').execSync('id').toString())\";a=''[['constructor']][['constructor']](p);a())]", + "\n" + ] + } + ], + expectedMatch: /^Invalid JPath expression: jsonPath: Cannot read properties of {2}\(reading 'constructor'\): / }, { name: "CSS selector", input: '
\n

hello

\n

world

\n

again

\n
', diff --git a/tests/operations/tests/GenerateQRCode.mjs b/tests/operations/tests/GenerateQRCode.mjs new file mode 100644 index 00000000..99ed8f9d --- /dev/null +++ b/tests/operations/tests/GenerateQRCode.mjs @@ -0,0 +1,67 @@ +/** + * Generate QR Code tests + * + * @author GCHQDeveloper581 + * @copyright Crown Copyright 2025 + * @license Apache-2.0 + */ +import TestRegister from "../../lib/TestRegister.mjs"; + +TestRegister.addTests([ + { + name: "Generate QR Code : PNG", + input: "Hello world!", + expectedOutput: "89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 00 91 00 00 00 91 08 00 00 00 00 e6 b3 05 ff 00 00 01 1a 49 44 41 54 78 da ed da 41 12 83 20 0c 05 50 ef 7f e9 76 dd 05 f4 47 6c c4 ce 63 e5 8c 0c be 4d 24 24 1c af dd c6 41 44 44 44 44 44 44 44 44 44 f4 9f a2 e3 fb 98 cf 2b ad 42 44 d4 2a 1a 07 c3 e7 37 83 a7 d2 37 88 88 1a 44 c3 18 1a 46 e7 ca 2a 44 44 7b 88 4a f3 88 88 1e 23 9a ef 09 44 44 fb 8a 82 b7 c3 3c fe 8e 8c 8d 88 e8 b2 33 6d ba b3 f4 9d b2 89 88 16 eb 90 f3 a5 ef a8 8c 12 11 55 f3 a3 61 a2 93 e6 4c c3 45 89 88 ba 44 a5 e4 e7 64 5d 9d 88 a8 5f 14 74 82 d2 8a 64 5a b4 24 22 6a 10 a5 2d cf 79 3f e9 6c 53 89 88 e8 a7 a2 79 4f a8 b4 b3 ac 57 6b 88 88 ae 15 a5 de b9 bc 14 70 44 44 3f 13 ad d4 21 03 ea d9 6a 0d 11 d1 15 a2 e0 ff 5f 47 07 36 22 a2 06 d1 4a d2 1f 1c 94 89 88 b6 14 95 ee d5 12 11 3d 50 14 74 8c 82 70 24 22 ea 12 05 6f d3 4b 2c 4b d5 1a 22 a2 cb 44 2b 69 7d e9 5e 00 11 51 97 e8 d6 41 44 44 44 44 44 44 44 44 44 f4 7c d1 1b 1c 52 72 cb 26 c8 c7 0b 00 00 00 00 49 45 4e 44 ae 42 60 82", + recipeConfig: [ + { + "op": "Generate QR Code", + "args": ["PNG", 5, 4, "Medium"] + }, + { + "op": "To Hex", + "args": ["Space", 0] + } + ], + }, + { + name: "Generate QR Code : SVG", + input: "Hello world!", + expectedOutput: '', + recipeConfig: [ + { + "op": "Generate QR Code", + "args": ["SVG", 5, 4, "Medium"] + }, + ], + }, + { + name: "Generate QR Code : EPS", + input: "Hello world!", + expectedOutput: "%!PS-Adobe-3.0 EPSF-3.0%%BoundingBox: 0 0 315 315/h { 0 rlineto } bind def/v { 0 exch neg rlineto } bind def/M { neg 30 add moveto } bind def/z { closepath } bind def9 9 scale5 0 M 7 h 7 v -7 h z13 0 M 1 h 1 v -1 h z16 0 M 2 h 1 v -1 h 1 v 1 h 1 v -2 h -1 v -1 h 2 v -1 h -3 v 2 h z20 0 M 2 h 1 v -2 h z23 0 M 7 h 7 v -7 h z6 1 M 5 v 5 h -5 v z24 1 M 5 v 5 h -5 v z7 2 M 3 h 3 v -3 h z19 2 M 1 h 1 v -1 h z21 2 M 1 h 2 v -1 h z25 2 M 3 h 3 v -3 h z13 4 M 1 h 3 v -1 h z17 4 M 4 h 1 v 1 h 2 v -1 h -1 v -1 h 1 v -1 h -1 v -1 h -1 v -1 h z15 6 M 1 h 1 v -1 h z17 6 M 1 h 1 v -1 h z16 7 M 1 h 1 v -1 h z18 7 M 1 h 1 v -1 h z20 7 M 1 h 2 v 1 h 1 v -2 h -1 v -1 h -1 v 1 h z6 8 M 7 h 1 v 2 h 1 v -2 h 1 v -2 h -1 v 1 h -1 v -4 h 1 v -1 h -1 v -1 h z17 8 M 1 h 1 v -1 h z24 8 M 2 h 1 v -1 h 1 v -1 h z29 8 M 1 h 1 v -1 h z27 9 M 1 h 1 v -1 h z6 10 M 1 h 1 v 1 h 1 v -1 h 1 v -1 h z8 10 M 2 h 5 v 1 h 1 v -3 h 1 v -1 h -4 v 1 h 1 v 1 h -1 v -1 h -1 v 1 h -1 v -1 h z16 10 M 2 h 4 v 1 h -1 v 2 h 1 v 3 h -1 v -3 h -2 v 1 h 1 v 1 h -1 v 1 h 1 v 4 h -2 v 2 h 3 v -2 h 1 v -1 h -1 v -2 h 1 v 2 h 1 v -1 h 1 v 2 h 2 v 1 h -1 v 1 h 3 v -1 h -1 v -2 h -2 v -1 h 2 v 1 h 1 v 2 h 1 v -2 h 2 v -1 h -1 v -1 h -1 v -1 h 1 v -1 h -1 v -1 h 2 v -1 h -1 v -1 h -1 v 1 h -2 v -1 h -1 v -1 h 1 v 1 h 2 v -1 h -1 v -1 h 1 v -1 h -3 v 1 h -1 v -1 h 1 v -1 h -1 v -1 h -1 v 4 h 1 v 1 h -2 v -3 h -1 v -1 h 1 v -1 h -1 v -1 h 2 v -1 h 1 v -2 h -1 v 1 h -1 v -1 h -1 v 1 h -1 v 1 h -1 v 1 h 1 v 1 h -1 v 1 h 1 v 1 h -1 v -1 h z22 10 M 1 h 1 v -1 h z25 10 M 2 h 1 v -2 h z19 11 M 1 h 1 v -1 h z11 12 M 1 h 1 v -1 h z5 13 M 1 h 4 v -1 h z28 14 M 2 h 2 v -1 h -1 v -1 h z21 15 M 1 v 2 h -1 v z13 17 M 1 h 1 v 2 h 1 v -2 h 1 v 1 h 1 v 1 h 1 v -2 h 1 v 2 h 2 v -1 h -1 v -2 h z22 17 M 3 v 3 h -3 v z5 18 M 7 h 7 v -7 h z23 18 M 1 h 1 v -1 h z6 19 M 5 v 5 h -5 v z7 20 M 3 h 3 v -3 h z29 21 M 1 h 4 v -3 h -1 v 2 h z17 22 M 2 h 3 v -2 h -1 v 1 h -1 v -1 h z24 22 M 1 h 1 v 1 h 1 v -1 h 1 v -3 h -1 v 1 h -1 v 1 h z20 23 M 1 h 2 v -1 h zfill%%EOF", + recipeConfig: [ + { + "op": "Generate QR Code", + "args": ["EPS", 6, 5, "Quartile"] + }, + { + "op": "Remove whitespace", + "args": [false, true, true, false, false, false] + }, + ], + }, + { + name: "Generate QR Code : PDF", + input: "Hello world!", + expectedOutput: "%PDF-1.01 0 obj << /Type /Catalog /Pages 2 0 R >> endobj2 0 obj << /Type /Pages /Count 1 /Kids [ 3 0 R ] >> endobj3 0 obj << /Type /Page /Parent 2 0 R /Resources <<>> /Contents 4 0 R /MediaBox [ 0 0 261 261 ] >> endobj4 0 obj << /Length 1837 >> stream9 0 0 9 0 0 cm4 25 m 11 25 l 11 18 l 4 18 l h12 25 m 14 25 l 14 23 l 13 23 l 13 24 l 12 24 l h16 25 m 17 25 l 17 22 l 16 22 l h18 25 m 25 25 l 25 18 l 18 18 l h5 24 m 5 19 l 10 19 l 10 24 l h19 24 m 19 19 l 24 19 l 24 24 l h6 23 m 9 23 l 9 20 l 6 20 l h12 23 m 13 23 l 13 21 l 15 21 l 15 20 l 12 20 l h14 23 m 15 23 l 15 22 l 14 22 l h20 23 m 23 23 l 23 20 l 20 20 l h15 22 m 16 22 l 16 21 l 15 21 l h12 19 m 13 19 l 13 18 l 12 18 l h14 19 m 15 19 l 15 13 l 13 13 l 13 11 l 12 11 l 12 14 l 14 14 l 14 15 l 11 15 l 11 16 l 12 16 l 12 17 l 13 17 l 13 16 l 14 16 l 14 17 l 13 17 l 13 18 l 14 18 l h16 19 m 17 19 l 17 18 l 16 18 l h4 17 m 8 17 l 8 16 l 10 16 l 10 15 l 11 15 l 11 14 l 10 14 l 10 13 l 11 13 l 11 12 l 9 12 l 9 15 l 8 15 l 8 13 l 6 13 l 6 15 l 7 15 l 7 16 l 4 16 l h10 17 m 11 17 l 11 16 l 10 16 l h17 17 m 18 17 l 18 16 l 20 16 l 20 17 l 23 17 l 23 15 l 20 15 l 20 13 l 19 13 l 19 15 l 18 15 l 18 14 l 17 14 l 17 13 l 16 13 l 16 16 l 17 16 l h24 17 m 25 17 l 25 14 l 24 14 l 24 13 l 23 13 l 23 15 l 24 15 l h21 14 m 22 14 l 22 13 l 21 13 l h15 13 m 16 13 l 16 11 l 15 11 l h17 13 m 19 13 l 19 12 l 21 12 l 21 10 l 20 10 l 20 9 l 19 9 l 19 10 l 18 10 l 18 9 l 16 9 l 16 8 l 15 8 l 15 10 l 17 10 l 17 11 l 18 11 l 18 12 l 17 12 l h24 13 m 25 13 l 25 11 l 24 11 l h22 12 m 23 12 l 23 11 l 22 11 l h4 11 m 11 11 l 11 4 l 4 4 l h14 11 m 15 11 l 15 10 l 14 10 l h5 10 m 5 5 l 10 5 l 10 10 l h13 10 m 14 10 l 14 9 l 13 9 l h21 10 m 23 10 l 23 9 l 24 9 l 24 7 l 23 7 l 23 6 l 22 6 l 22 7 l 21 7 l h6 9 m 9 9 l 9 6 l 6 6 l h12 8 m 15 8 l 15 7 l 13 7 l 13 6 l 16 6 l 16 4 l 15 4 l 15 5 l 14 5 l 14 4 l 12 4 l h16 8 m 17 8 l 17 6 l 16 6 l h18 8 m 19 8 l 19 7 l 18 7 l h19 7 m 20 7 l 20 6 l 21 6 l 21 5 l 20 5 l 20 4 l 17 4 l 17 6 l 19 6 l h24 6 m 25 6 l 25 5 l 24 5 l h22 5 m 23 5 l 23 4 l 22 4 l hfendstreamendobjxref0 50000000000 65535 f 0000000010 00000 n 0000000059 00000 n 0000000118 00000 n 0000000223 00000 n trailer << /Root 1 0 R /Size 5 >>startxref2111%%EOF", + recipeConfig: [ + { + "op": "Generate QR Code", + "args": ["PDF", 5, 4, "Low"] + }, + { + "op": "Remove whitespace", + "args": [false, true, true, false, false, false] + }, + ], + }, +]); diff --git a/tests/operations/tests/Hex.mjs b/tests/operations/tests/Hex.mjs index 3bb89544..6e49f6f8 100644 --- a/tests/operations/tests/Hex.mjs +++ b/tests/operations/tests/Hex.mjs @@ -43,6 +43,20 @@ TestRegister.addTests([ } ] }, + { + name: "ASCII to Hex with percent deliminator", + input: "aberystwyth", + expectedOutput: "%61%62%65%72%79%73%74%77%79%74%68", + recipeConfig: [ + { + "op": "To Hex", + "args": [ + "Percent", + 0 + ] + } + ] + }, { name: "ASCII to 0x Hex with comma and line breaks", input: "aberystwyth", diff --git a/tests/operations/tests/Hexdump.mjs b/tests/operations/tests/Hexdump.mjs index 90523a08..6eb486db 100644 --- a/tests/operations/tests/Hexdump.mjs +++ b/tests/operations/tests/Hexdump.mjs @@ -152,6 +152,17 @@ TestRegister.addTests([ } ], }, + { + name: "From Hexdump: xxd format, odd number of bytes", + input: "00000000: 6162 6364 65 abcde", + expectedOutput: "abcde", + recipeConfig: [ + { + op: "From Hexdump", + args: [] + } + ], + }, { name: "From Hexdump: Wireshark", input: `00000000 00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f ........ ........ diff --git a/tests/operations/tests/JA4.mjs b/tests/operations/tests/JA4.mjs index 0fb4624e..699dca40 100644 --- a/tests/operations/tests/JA4.mjs +++ b/tests/operations/tests/JA4.mjs @@ -30,6 +30,28 @@ TestRegister.addTests([ } ], }, + { + name: "JA4 Fingerprint: TLS 1.3 with whitespace-only ALPN", + input: "1603010200010001fc0303ed338a18e711d670cdc472ff570a5b59f1ace12e5365918bf68bf845019147b6207e4437bfb062d98a4aeb753be8f09022a9dc9413d7694dad4db57fcdcf076e820024130213031301c02cc030c02bc02fcca9cca8c024c028c023c027009f009e006b006700ff0100018f0000001800160000136465762e636f6e74656e74677261622e6e6574000b000403000102000a00160014001d0017001e00190018010001010102010301040023000000100004000201200016000000170000000d002a0028040305030603080708080809080a080b080408050806040105010601030303010302040205020602002b00050403040303002d00020101003300260024001d00207af053336d5e2c1675aa4c6ce78de5e5fdbd296538113f051ea17ccb64289f22001500d2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + expectedOutput: "t13d181220_85036bcba153_d41ae481755e", + recipeConfig: [ + { + "op": "JA4 Fingerprint", + "args": ["Hex", "JA4"] + } + ], + }, + { + name: "JA4 Fingerprint: TLS 1.3 with ALPN containing a whitespace", + input: "1603010200010001fc0303273682a603be3f64dd025df4ad0f4d2d13043c3a233405a68bb29b865808749a20f4dfc40242b2fce38fae26c516ef9bef20a1b9349eba3c003780168d72471f5c0024130213031301c02cc030c02bc02fcca9cca8c024c028c023c027009f009e006b006700ff0100018f0000001800160000136465762e636f6e74656e74677261622e6e6574000b000403000102000a00160014001d0017001e0019001801000101010201030104002300000010000500030261200016000000170000000d002a0028040305030603080708080809080a080b080408050806040105010601030303010302040205020602002b00050403040303002d00020101003300260024001d0020f4dd1567bd858d3a9f1d88db1fee6a10ab0ea1aa6afe96ffb6a7c4d79dea4075001500d10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + expectedOutput: "t13d181260_85036bcba153_d41ae481755e", + recipeConfig: [ + { + "op": "JA4 Fingerprint", + "args": ["Hex", "JA4"] + } + ], + }, { name: "JA4 Fingerprint: TLS 1.2", input: "1603010200010001fc0303ecb2691addb2bf6c599c7aaae23de5f42561cc04eb41029acc6fc050a16ac1d22046f8617b580ac9358e2aa44e306d52466bcc989c87c8ca64309f5faf50ba7b4d0022130113031302c02bc02fcca9cca8c02cc030c00ac009c013c014009c009d002f00350100019100000021001f00001c636f6e74696c652e73657276696365732e6d6f7a696c6c612e636f6d00170000ff01000100000a000e000c001d00170018001901000101000b00020100002300000010000e000c02683208687474702f312e310005000501000000000022000a000804030503060302030033006b0069001d00208909858fbeb6ed2f1248ba5b9e2978bead0e840110192c61daed0096798b184400170041044d183d91f5eed35791fa982464e3b0214aaa5f5d1b78616d9b9fbebc22d11f535b2f94c686143136aa795e6e5a875d6c08064ad5b76d44caad766e2483012748002b00050403040303000d0018001604030503060308040805080604010501060102030201002d00020101001c000240010015007a0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", diff --git a/tests/operations/tests/JWTSign.mjs b/tests/operations/tests/JWTSign.mjs index a7752138..395a8196 100644 --- a/tests/operations/tests/JWTSign.mjs +++ b/tests/operations/tests/JWTSign.mjs @@ -15,26 +15,52 @@ const inputObject = JSON.stringify({ }, null, 4); const hsKey = "secret_cat"; -const rsKey = `-----BEGIN RSA PRIVATE KEY----- -MIICWwIBAAKBgQDdlatRjRjogo3WojgGHFHYLugdUWAY9iR3fy4arWNA1KoS8kVw -33cJibXr8bvwUAUparCwlvdbH6dvEOfou0/gCFQsHUfQrSDv+MuSUMAe8jzKE4qW -+jK+xQU9a03GUnKHkkle+Q0pX/g6jXZ7r1/xAK5Do2kQ+X5xK9cipRgEKwIDAQAB -AoGAD+onAtVye4ic7VR7V50DF9bOnwRwNXrARcDhq9LWNRrRGElESYYTQ6EbatXS -3MCyjjX2eMhu/aF5YhXBwkppwxg+EOmXeh+MzL7Zh284OuPbkglAaGhV9bb6/5Cp -uGb1esyPbYW+Ty2PC0GSZfIXkXs76jXAu9TOBvD0ybc2YlkCQQDywg2R/7t3Q2OE -2+yo382CLJdrlSLVROWKwb4tb2PjhY4XAwV8d1vy0RenxTB+K5Mu57uVSTHtrMK0 -GAtFr833AkEA6avx20OHo61Yela/4k5kQDtjEf1N0LfI+BcWZtxsS3jDM3i1Hp0K -Su5rsCPb8acJo5RO26gGVrfAsDcIXKC+bQJAZZ2XIpsitLyPpuiMOvBbzPavd4gY -6Z8KWrfYzJoI/Q9FuBo6rKwl4BFoToD7WIUS+hpkagwWiz+6zLoX1dbOZwJACmH5 -fSSjAkLRi54PKJ8TFUeOP15h9sQzydI8zJU+upvDEKZsZc/UhT/SySDOxQ4G/523 -Y0sz/OZtSWcol/UMgQJALesy++GdvoIDLfJX5GBQpuFgFenRiRDabxrE9MNUZ2aP -FaFp+DyAe+b4nDwuJaW2LURbr8AEZga7oQj0uYxcYw== ------END RSA PRIVATE KEY-----`; -const esKey = `-----BEGIN PRIVATE KEY----- -MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgevZzL1gdAFr88hb2 -OF/2NxApJCzGCEDdfSp6VQO30hyhRANCAAQRWz+jn65BtOMvdyHKcvjBeBSDZH2r -1RTwjmYSi9R/zpBnuQ4EiMnCqfMPWiZqB4QdbAd0E7oH50VpuZ1P087G +const rsKey = `-----BEGIN PRIVATE KEY----- +MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDnBZHfKzx27jc+ +9cFPj3b42HO8auxjtlpJpiWgMluSJi8ECrN3iIODf5H9xf1Np61+4xtz3SDKibdA +XgB9rhXRz6LcRNN962QtIvKriI+Mr9EEaAwNFYziZ8bhDVgawheWCqSJO0DjDDDk +0CTbfl7SeIhcTuoPXeWFQICUsyc6w3uE+KWnnPZnK9l3R02ssBjsqQhf3LZ9bz04 +52ahhuBg1BgBOIeu8Y8hzTAjsOuMDZ7XV8MbEpcmOYRy46vEjRTl3ZIpYoS0v5st +M60swjnPiv43oBAsziVddIJWnh+TnBacnuhHl7amuGCLspogftJGefuGDNxIJOLH +mPaO5R7vAgMBAAECggEADZn32SZQBIaI7SWF8Ju3OvZvdffrnAFH9o8YJwLf/k5O +NVQ19cMtTwgrPcAy5igJoG9Zlew+en46Mkl2iO+/bB9n7MUGmKLLvpaQqAW9weA2 +E6bWksyig0/t1yE0fzrPLa/JuSSqcNOua0JP8TZS+dxL1vd0c1wpX7uI9nhHxn9Q +OJNY6N+ebeIjEugYJaeaLWj6cQ1x9V0+JealQtlra4Xex/CwczqPLKD01bdPe/Fn +5iLG8/dIofHz+615UTC52vwKaL2JiWUHX9gBlahrZYOuhxJQ1RRAf03+Ij2hyUwa +tOKglPZIhDajALfU3qSfOfRHnMKpakdA9tiZ1TTIvQKBgQD5lUvlZOfY/WdkHl3u +RnF3g/lWT4dRzdcezeYkLAdYcu5Q1ExVlYPezA9tYD2uR7cziJy/em1v0tPXzCSL ++BGB8/Ds4wg3QYnV8RXgI/4XxXf2iNbfJEfJ74nxza1/9L9Bnvg1OZLcdagu+Ria +p8y3hWzbBie52o0T8s/KDo2/PQKBgQDs9hseyloiDqsmW7hfLw+AiH1IGwXgK53b +ZeBwtASr7SYD1Ej0xFZ5SZ/OukjdDAQoyrivpjPcCjXxR1eoCA857S/+sSRPk+Gw +3+9lWys7jd4VEWvQgV7PKwGGVc1Ku/aKjNbNnu4HxbQfb7bJZnvoW8WqsqHhT/2z +bFnuYVD5mwKBgQC88adpXECg5wX0p4CYuD+CKSkDjGV3KoumyF1oGOTesvNzwaSg +TfZtHrK3LNrFK4mnu85erwJWW5cAkY1BYWVvqgtEaoN3wWflzQOwkc70lAvDWcjB +WSf32h3mLr0gV1rLBNwG/zUNLQ1LskxMGKhEbv//t+MvMiMHbRSddPMeSQKBgQDm +H8QKzP1nodM4905AshVeAC+a/RNhtzogvfmPumPnC/IlOd54RsysEYIvY94rPeY0 +L1vYyZIHmar1XRGVz+3plZ1MvX/EAJvoCDIXvshnl8kbsMWBwoHus5dRfLZYY950 +g36ARl5oEepxtS5QvUSMTcPTmJN5mxOJUiqsRLo9DQKBgQDyOatwmZLrWs8Sipet +pdJpPnBJ1TE+Dm1WmaUfmjoXJxi07Bfikex5ybqqed49s5TSb2OBU4eG/yVLQcix +ik0m4tG0NSEJ/EgfwUxdteHSjGmWnuiK0r3oAz6ffE32RfqvEoFRcCh/H8MdkVtg +ErVnxmpzv5elRSZ/DUn2uygxgA== -----END PRIVATE KEY-----`; +const es256Key = `-----BEGIN EC PRIVATE KEY----- +MHcCAQEEIA3ISxaDm/NdIVmkuAWR5VTNNj2PTpe+eWhv2rUhNE9joAoGCCqGSM49 +AwEHoUQDQgAEY5Iad2fwtKm40eqg+hx4sxwsZwKm0WP/GDNGAPUisD3H2AlLedYE ++xZ8cehEKjddb6Bftv0I3PLGFMBQIyE0pA== +-----END EC PRIVATE KEY-----`; +const es384Key = `-----BEGIN EC PRIVATE KEY----- +MIGkAgEBBDAp0jx0wSk6L2od/DbovYvrhG/AKXAFpqaQ7/u8tgg7w0lBHWrA9yHF +YG1Z0k5lEACgBwYFK4EEACKhZANiAASYGNRZMaBebhOkwML7V4JJgiXqukoopqun +xXWTCEw4qCEqydsXE6TFVB2RJ0+hpjoK00XqVVvyv8fw6ZYH9y5dHmj0RsnBMrAm +oOhhUpXlZWsfiY97db80mKCp7n2MkNw= +-----END EC PRIVATE KEY-----`; +const es512Key = `-----BEGIN EC PRIVATE KEY----- +MIHcAgEBBEIARI9C6QrByhpJ8paMAgKyz6piOIEF2wDxlPEFcVC3ZHSo4crE2Uc5 +E94EOuLNnKs/TinGMiTUhbefpfETI5SML4qgBwYFK4EEACOhgYkDgYYABADka9q3 +ZXy2j1ml6fQqFbG6ryD2+2Cu43xxDeEoec9PW4Dfe/hmkluYwSv15X5+VhBx36sh +Jeh34sXjACyMVXfLGQGS3Puxol0c1nyC1uv9ecxLJmWUtUmPm9Uz87tb3vhI636x +8YT3MpqHkOZnDm4CiG09QIS9ROUHKH/BGQ7QtH/9yA== +-----END EC PRIVATE KEY-----`; TestRegister.addTests([ { @@ -88,7 +114,7 @@ TestRegister.addTests([ recipeConfig: [ { op: "JWT Sign", - args: [esKey, "ES256", "{}"], + args: [es256Key, "ES256", "{}"], }, { op: "JWT Decode", @@ -103,7 +129,7 @@ TestRegister.addTests([ recipeConfig: [ { op: "JWT Sign", - args: [esKey, "ES384", "{}"], + args: [es384Key, "ES384", "{}"], }, { op: "JWT Decode", @@ -118,7 +144,7 @@ TestRegister.addTests([ recipeConfig: [ { op: "JWT Sign", - args: [esKey, "ES512", "{}"], + args: [es512Key, "ES512", "{}"], }, { op: "JWT Decode", @@ -163,7 +189,7 @@ TestRegister.addTests([ recipeConfig: [ { op: "JWT Sign", - args: [esKey, "RS512", "{}"], + args: [rsKey, "RS512", "{}"], }, { op: "JWT Decode", diff --git a/tests/samples/Images.mjs b/tests/samples/Images.mjs index 7ee39643..663fa201 100644 --- a/tests/samples/Images.mjs +++ b/tests/samples/Images.mjs @@ -18,18 +18,6 @@ export const GIF_ANIMATED_HEX = "4749463839610f000f00b30b00424242ffe700ffef00ffc */ export const PNG_HEX = "89504e470d0a1a0a0000000d4948445200000020000000200806000000737a7af400000006624b474400ff00ff00ffa0bda793000000097048597300000dd700000dd70142289b78000005184944415458c3c5575d6c145514feeeccecccacdbddb6e096a5dbcdb6d06d80d06090466d6953454ab52ad0a65589840ac1d02a313c989af062820fa66210130d9a68b0363c34610135690b188b7183c13f44506c8115ba535ab6ddd2617f667f66ae0fb41596ddee2eadf13c4de69e7bcf77cff9cecf25b83f613b3b3b975b2c96f25028c47a3c9e1f5a5a5a7e05a0016000d0c9ef9442d23448a60edeb973a769c78e1d077272721a65594620106000505996bf1a1f1f3f67369bebc2e1f0ef6bd7aedd0a409d2d00e2743a1f2929296915046199a66901007aa3d1580600131313da24000000a594124288aaaab72a2b2bed1d1d1d8f8ba2386fc3860d9f25f3c84c0088cbe56a2d2c2cdc4708d12552880770a7288a3228088215003c1ecfd68d1b377e9e488f4b66dde974aeb2dbed498da71251146d538ed1b4e4746092dddee170b4300ca3c32c251c0edfd8bc79f3d164de4e0680110461794a02119292c482202c387efcf86f3d3d3d7b13814816024a2955e62a8b4451b4abaafad8e485d5743ca005028153699c4dd30c83140a857e4c9409c900a0bbbbfbc368343a34a3754a693a1c58b76eddf2dadada5d89002705b07bf7eee13367ce3cab284aff6c482808425e6767e70bc9ea0033d3e6c6c6c65fd6ac5953a1695a3453c3a150c84d295529a59aa669914cd3705adc6eb7926eaca74455d5605555d5c3030303f59224bd525f5f7f30992e87ff40344d5328a5caa64d9bbe4ca5cbe07f1666ae522dae40a5dd8ed30941c8e5727d63341a9f8a5f181a1ac2f0f07022029e02109d2b00bae2e26207cbb2f72cf03c8f9c9c9c441c580c804dc70b330258b6c020beb87ac9abecb59f8b087377b4f4f30a68b6de482549a29224ddb5168bc51cd5d5d54ff6f5f575cfa69633edeb971c78e2d195db055e77cfb6a2eaadb816e5b59ffafb19a7d3095555e3ab64341a8d96f6f6f6fe755f247c69d542abd9c0bd3c70f90a628c30fd5f56542c5c550fc3837600406e6e2eca9e2e433837fcefc0c8b2e079fe7b9fcfe7aba9a9296613c52f55084acc864a027013b28c828a2d30e805bcbe670fac4b5740f5a9285b18c6a0db4da8c180fdc6fdb035d850c555a174a4148410b85cae7293c97442a7d395363434347775757d91b6075a2a6c45d66ce18369258685de644659d96af45ff80345f9f908c932821313c4eff7639b6d1b06838358242c82d96c86288abe582ce6e6797e052184701c9797910796e61976b10c991fff7f7b5313b6373541d5340426d36f747414e5c67294679503a1e90634e6f57adbac56ebb14020f0e9a14387decf84038c8e232b53b45888dc6dec63636389d290c9caca5a3d09a6a2a6a6a628130054d33092a2c52272bbe4515996113f16288ab2c86432bd01001cc72db5582caf651202eaf5473e7e80d7af270409d9cb320c0c66331ca5a5602c1624180d492412392bcbf2db46a3f1394992f665c481b77a2f9f78e719476b5e16ff2e00d31dae8524cb30e8f560390ee72e5e243d7d7d34168bc16030a87575752ccbb20400a2d1e8b7478e1c390ce0f0fd5442fae6d7039f343d643956345f5fcbf1fafd00b219868145afc78d4b97101a1b833a32426d361bcdcfcf87cd6663a7a6649ee70725497a6faede86e4c2c993cf171716eee5753aeb9d0b7f5ebfae5df67a99b86164e8e6cd9badcdcdcdc7d27ae5a6a3f45147c7794dd30e2e59bcf896c0f3851ccbe602c0a8df4fc783413269d8130c06f79d3e7d7a4b5b5bdbd9b45b77c60304c3f0df75752db31714acf8dbe7cbbee2f5fafd7efff9f6f6f6b357af5e8d647ade3fa1780bad734c65970000000049454e44ae426082"; -/** - * The CyberChef logo with 'chef' - * 32x32 - */ -export const PNG_CHEF_B64 = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAHqElEQVR4AcXBfUyU9wEH8O/v9zz3PHfPvXLewXHnxYKgYCFW6ktHmXUySIdKcVlFs2ZkrRB1m6kx00XTbGJjFrvVTSexZusGviQqwsxImM5laOZclG3EisEXWK2cvBwcuYN7456XPawQb+fx4l/7fAji5Obmvrlx48ZKjUZjlyTpaXNz89nOzs42TDp37lzLwMCAcefOnWtPnz6d53A4CsPhMNPb2/v37du3/wuADIACUADImIZer3e3tLS0rVy50k2gIqo9e/b8et++fd8+ceLEqXA47Jk3b97SmpqaDTU1NT+ur68/BICeOXPmEsuyzry8vAcWi+XtQCCAYDBIASiBQOAPIyMjd+x2+7poNPpZSUnJuwAkJLFr165j1dXVlQUFBa+yUBUXF79TW1tbtWTJkrXd3d3XMam9vb325MmTH27durXc4XAwBoPh1Z6eHqSkpCzDl2R8iZhMpnKj0biBqHiez+I47v2GhoavabVaa0VFxacAZEwqLy/Pa2xsbI9EIk8YqA4ePPhJa2tre2Nj40d4hnz88cerMzMz1/T29rrS0tKcLMvC7/eDUooJg4ODBCpCCAghICqoxsfH+aqqqr2CIFTabLbykpIS74ULF24zDKPbvXv3nuLi4rUmk0mfmppqoQzDGMvKyl55+PDhdcRpampavnjx4v3d3d1wOByY4nQ6IQgCIpEIrFYrVq1aBVEUMcXv9yMjIwNOpxPp6emw2WzIz8//lUajMQNg9Xp9oSiKxvT0dLsgCF+hPM/rLRaL9tGjRwN4hmRnZ2+nlGoMBgMEQcAUk8mEkZERmM1mqORbt24hJSUFExRFgcVigc/ng9frxejoKHp6eiRRFCPl5eU7JEkaPXDgwPq+vr67p06d+lttbe0GCoBAJUmSjGcoz/N5SKKrqws2mw0TiMrv98PlcmFCIBBAQUEBBgYGEI1GEQqFwLIsA0C7Y8eOQwAIJlFKCVSsLMsSVHa73YRnFFUEsyOKooAQggmiKGJCcXExEoVCIagoAAlx2Gg0OtzR0dHndruz8YwcDAavGQyGr46NjSEQCMDlciEJBQBBgpaWFpjNZkyJRqOxYDB4DoCMBFRRFOnixYstmzdvrmQYRodJra2tx30+HxYtWgRZlpGMokIcnuchiiIcDgcEQYAgCGAYZrCysvKlioqKKgAKElCo6urqDmZnZxuOHDlyRhCEBZRSXV1dXaYgCLh//z7S09MxFwaDAbdv30ZWVhZ8Ph+i0SiCwWBqZ2enp6ys7H0kwULl8/me5OXlrTl+/PinwWDwc6gikYh49OjR39fX139w5cqVfwLQMAwDQgjiEUJAKcUUhmHQ1dWF1atXg+d5yLKMtrY2XL169beIwzAMhYogDiGE8jyfrtVqrcFgsDcWi40AMPT29g5TSrlwOAxFUSAIAib4/X55ZGSEiqIIQRAwRZKkUFFRUf6xY8c2m81mecuWLYcByJjEsqxJUUmSNMoijqIociQS8UQiEQ+S0Ol0SMRxHDiOQzxZliOxWKxv27Zth5CEKIoBTKL4P6OYnYIXRAhRAMiYAxazC9+4cePPRqPxG0jw9OlT9Pf3I1E4HL4GIIY5YDE7TVZWVjbDMEjEcRwsFgsSybK8EAADQMYsWMxgSZpeu6Uo53vMF//IIJQins46XzHrjIrH41E8Hg/iiaKYvWbNmq+3tbW1YhYE06OH38o5sfa1gmqe0+B/EWSseRdfxDi5/cED2tTUBEmSEE9RlJgq//Lly/cxA4ppvLM83WXXs9992N0DkfKYEohISF/+TehtCzAhJSUFK8pWIJoSxRSGYcBx3F99qtLS0ixGhWkwmMa3ljrWW3Ts28FwBK9t/gBpOYU4cPYKvNZcGMxpSLNa8dm9exA1GrKf7IdmqQbLVi7DG+43kJOTg6GhIafNZiuzWq0HMzMzuzs7O+8gCYoktr/uznCZ+aOYRCkDncmOFSuK8KDzHjKcToQDAYT8fjI2Nob33O/hSegJMvlM2O12aLVanyiK/+Y4bilRsSybimmwSCI3Vb+LoWQeElRv2oTqTZsgyTKC/f2YMDQ0hEJjIQoNhUAY/8Xz/LDX693rcrkuBYPB35w9e/YXmAbF86iGJQWYQTQahZZlMWF4eBiJZFmmBoOhCCqe518vLS3NwDQonqfIMgYwA57nMQ4VIUogEICiKIgXiUQyTSbTD6FiWTbX4XB8H9Ng8TzFOzb+icDp3iIEDJJgKIXebkd2fj6owwFCCBKQ8fHxjkAg8KHRaCz3eDxHMA0WSfzkcveffro+e0eqgfsIgAmTZFmGJxCAXqcDw7K409VF/tjWpoiiCL1eL61bt45REahisdhfmpubLwK4iBmwSE75UcvDk5tecVzKmKd7k+V0vwRgppTCodNh8NEjhIeHIQ0MKG63W3E6nXC73QxRQcVx3BOPx/NzzAGLGZzv6B8A0PCdQW80S9D/jNNoXBqeh+vllzEh1tenWLxeijiSJD0NhUI/uHbtmgdzwGAO6hoa7sqy/LuchQtHeY57iWWYFKiGxsaUkVCIQCVJUm8oFDpy8+bNqr1793ZgjgheEKWUu37+/JIF8+cv/dznM/d4vWOqu4cPH+54/PjxOF7QfwCiFwbr9BCaBwAAAABJRU5ErkJggg=="; - -/** - * The CyberChef logo with blur - * 32x32 - */ -export const PNG_BLUR_B64 = "iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAANT0lEQVR4AS3BC5CV1X0A8P8553s/7mMvyz5gWUFApEKpEtloSQdLDDDoREXMDK1Zx8dg4xjHqdWpQwgI29QoFrE6gyFJ6YhmoDNMapIBYhzHqgg1ZAvRdIVld5Vl9+597N17v+8779NNJ78fklL6GzdutJ955hnnrbfect98803vxIkTwccffxwdOnQoGhoaihuNRiilDKvValCr1XzGmNtqtdz29naru7sburq6dG9vr1i6dClbtWoV7evryzZv3pw8/PDDSX9/f+vIkSPN/fv3t86cOZMYY7KBgQFarVY5AAjr4MGD6KOPPsK1Wg0bY4ht25Y9q1gs2h0dHW6apm5PT4/HGPMrlYpv23aQJIk3y8nn85bneYgQopVSglJq1et1Mjk5iS5fvqzPnz+vzp49K44fP85uueUW++jRozalVDz77LOkUCjg/v5+hI8dO4YajQZSSuE0TYnW2rJneZ7nlEolt7293SuVSn5nZ6ff1tYWtrW1hcViMczn81EYhpHjOBFCKNJah5TSsNVqBZVKJRgdHQ0uXLjgnzt3znv77bfdo0ePOkeOHLEPHTpkHThwgKxbt46sWLECk4sXL3ozMzPWmTNnnEaj4QwPD3vbt2/3a7VaeOXKlVBKGRFCIsdxIilluGPHjnDXrl0BQsh3Xdf3PM8dGBiwXNe1fN/Hvu8jz/MgjmP98ssvq3379qkoiuTrr78ub731VvHhhx+qbdu2qf7+frV69WqNq9UqmpycxK7rYtu2ied5VhAEdj6ftwuFglssFr1SqeTncrkgn88HuVwuCMMwCsMw8jwvtCwrJISExpiQcx6maRq0Wi2/Uqn4X375pTcyMuIODg46586ds9977z373LlzZHx8HJ8+fRoXCgVEDh486D755JN2uVx2xsfH3eHhYf+JJ57wa7VaVC6XIyFERAiJACBijEWMscgYE+zcuTPYs2ePZ9u2Y9u25TgOdl0XeZ4HnufpKIpUHMfqtddeEwMDA2LZsmX85MmTYnx8XGit5djYmHznnXcUNsagKIqQbdvYsixSKBRIGIZWGIZ2oVBwCoWCm8vlvCiK/GBWGIbBrDAIgtBxnJAQEgJAqJQKpZQB59xPksRvNptuvV53JiYmnMuXL9vDw8PW+Pg4GRoaIrVaDc+dOxeVSiWE169fD3PnzkVdXV2oVCqhfD6P4zgm+Xye5PN5K45jO5fLObNcjLFHCPEAwEMIeUopXwjhc869LMu8VqvlzszMOI1Gw6nX6061WrUbjYY1PT1Nrl69SkZGRvDZs2fxBx98gF599VX0/vvvg3XvvffCyMgILFiwADzPQ/l8HsVBgKMowgBAQGsiGLNZltmcMZtS6lBKXZplLmXMUlIiTDC2bQdmScdx7DiOSZqmmDGG0zTFjDEkhEBSSlQqlaC3txd6e3vhtttuA7xo/U3w1W+uN/kFeQgLIfixBcR3QAFHQDQSWmHGKU7ThCRJy8rS1Mqy1KKUWlma2hmlVpZRizFGKKWEMYYZpVgIgYQQIIQwWmswsxhjptFomMnJSTMxMWFGR0cN/un3vmX65gLc3NtrlnTnTGQBBJYCDzT4WANIhjRniGUJZlmGGU0Jp5QwmhEhOBaMYc4Z5oxhKTkSgiMuBCiljBDCKKU0xlgbY7SUUgshtBBC53I5PTg4aPC2mwEe2txjruuYhqXzjJmf12ZOwE3B48ZDythGGC0YSEpB8AxxRpHgDEkhkOQcCcmRFAIJKUBKZaSURv8JIUTZtq3iOFBxHKv29nbl+77u7OzU9XrdvPTSSxofe+4ec20nwI2LPFOEFnQEyrR5yoRYGFdnAJKB4RQES0EyCkowkIKDksJIJY1S0mgltdZSKyW11koBAomQkRiDJDaRYZyTxWJRBkGg2tvblW3buqurS1+6dMngB5ZWIPnlHLN9QwPuukmba4t1mAMzUCDceIoZWzEDghkpqJGcghLCKMGNUsJoKYxWSisttVZaaa2UBiOVlkoDSESIAAAZBZG0bVs5gaOKxaJatmyZWrBggR4YGND4ujv/F368+HO4zxuBlfAFdMsyBGwSSFIFyJogswaIrAkqS0FxaiSnoJUwWnKjlDBKCaOU0lJJrZTUUkqt1Syp/h8QkEEcSMdxlOu6KteeU8YY3dHRoc+cOWPw/i9+jrak/42+VZiG7mQUdcsy5NIKqOkJBHQadNYEmTaBpy0ksxRpRkEwiiQXoIQwUgijpDBKcCOl1FJyLaVUUnOllFCUUi200MY1iraoHjo/ZJIk0fPnz9eHDx/W+HH/12gd/gA5w+/iztZFBONDmE2N4GxyDNPaBGb1Ck4bVcyTJhI0QYJlSHEKklOkBAfJOXDOQChhhOBGcGY4Zyaj1LSyluFZpgFAN5tNM1GdMIwxff78efPuu++aU6dOgfVt979QbvBXeKU8iMbGz2OYvIhVdQyLX43jrDpJ0ukqyWamMU9nMM+qmNMUS8aQ5BQJqZAEZLAhIAgBJhhwLkxKU6BZZrI0MzNJYrjgZmZmxkxVpsyJ/zwBr7zyCnz66adw3333GXz29ZfwzewjhC++jxuffkySkQskHf2cVL8Ytmh9ktDpCskadUJbM0RkCRY0xZJnWAqOpOBIco6E5CAEA8E4MMaAMgpZlkCz2YR6ow6N6QZUK1UYGx2Der1uyq2y4ZybO+64A/BN079GldO/wJfOvEPY+CCuj1wg5dE/WDMTo2RmatLKGjXCZupEZgmWNMWKUywZw5JzrKRASnKkhEBCCCQlBy4yxBmFJElQo9lA1WoVVWtlNDE5AZ999hkc/tlh9MjfPIKGhobQ7t27AV/+xXEMnw3i4MolTEcvEqt2FaNqGbNKhdBalfCZBmFZiwhKsRQcGyGRURIZJUEribRWoLQGrRVorUAqDZxzxIWAjGbQSmZQlmZQmaqgNE2h2WxCpVKBsbExGB8fB3wDrqP6l5/hrDqC82wa6Zk6pq0Gps0ZTFtNLFmGNOfIaIlAKQBjAAEYBAaQAYMAGYSMQQjMHwFoAwBGSA5SStAKIOMcwaxas4bK5TKCP7nzzjuR1YMFKhhAJZCo2qKYMIkMk0hQgUBrwNoAwdhYCBvHsnSVSG0RrW3LKI0MQoCUsSxlWZayLEtb2NKEEI3nYYPAzJJGKWVaSQsajQZUKhX4zUe/QfPa5qGTJ08CXpJJdG9vAW4qRtDrW9DmAoQA4CNsbGwZxyLGd2zl25byHVsFriN9x5G+6wrf9YTneSJwPRF4vgh8XwS+LwPPU0HgKdfxtesF2nd843u+ieLItOfazZL5S8ymTZsMzMLJvwHA+wA9dd8sJLF2pWdsJ9DY97Tju8oLA+n5vgziiHthyP0wYn4UMtcPeRCGLA5DFoUxi4KQ5+KYx1Ek4lxO5OKcbCsU5JxiUXV1zVVd87r00oVLdU9PjwmCAP7o2LFjhry3d2N4+O57rHXXbrceXFN12r7ZdNY8IJwNZeVeyoxzRex2ptCAXdu5x2ruskn6nIWetmwQjqvBcRXxfGEHAQtzuSzOFdK2A6WkY25H0tXdnSy8ZnFy3fLl6e8G/yfp+0pftmHDBlq+WmYHDhzg99xzj5yamlLk0Z9sCcJ3P7YW5bZbz94urTm/Z/aND0rnzjo4f5va9rhy7Wnjkgb+J9zAe3HzuQFI93haOp4CJxA4iJgd5TK/WMj2zfnXpK2jM5nX29vqXXRta8Wfr2itX7eudfHzS+mWLVvSx7/7OH3hn19gfX19or+/X65evVpZA3/do89vvVHNt1dKtuoTma4SYskKwntO+WxOo0Bj08hcXHeQk1nIaWLldxk6l0tFhUW0QTYQ5bou87u6szn5Qlrq6Uk7FvRmi66/Plu+chW7Zc0tfNfePeL2zbfLPd/fo3bs2KFaqKURQnrFihXGemP9Tfr03YPq9xNfqN1fvUGOfh+LNZditvgvYtZZLdO8PZ15uGwTr0mM30Ki0TKMSoEYt4hQiBBL2a7L/TkhzRXb0tKSpen8xQuzJStW0r6vraUbH3iQbd26lX9y7hOx43s7JG1QFcexPn78uFm7dq0h8Vs/cb+9Zht56FSAH97yPH7hoX3kuvJu646nI3L3EzEZsfJ4nNl4yg3RlBPCd93I1N1QGz9SVhALLy6yuNROCws6s+6enuSalSuT6//shuTmvjXJ3Z/8Lnnq0UfS3c/tyfYO7KXLFy9nzWaT7927V7744oty06ZNmtzK1zul+/4R/3uvwVu3tuOd93vkmseeJxv4D8iG7+wn255rw2MU4yt2iCZIgL7j5syUH2vsx8rLFbmfL/GX2jtp+7Xzsnm916SLb1ydrl79leT2D7+e3L/l3nTgqX/Ifvyjn2Zv/OwN+tsLv+Wff/q5LJfLIgxDjTHWZN8f9ts3tp5HT/3gGXz6/g789GNz8DWPReSvdkTk1OUfki279uPhp3bii8jDV6wAHvYiMxHntRXmlBvlZVTsYP/S3sU6li3IehYuypavXZv+5dfeSU5//RvZ3//do+nCMMiOHv0PeuKXJ9iVkSvirv67xOGfH5aPP/i4unr1qv4/bGwpHb1ZNmYAAAAASUVORK5CYII="; - /** * Sunglasses smiley * 32x32