![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
crosshash
Stable, cross-platform JSON serialization and hashing for Python and JavaScript.
To make it possible to compare and hash JSON objects in a stable way across platforms.
pip install crosshash
npm install crosshash
The following functions are implemented in both Python and JavaScript and the output is guaranteed to be the same:
crossjson(obj) → str
JSON.stringify()
(lowest common denominator)crosshash(obj) → str
crossjson()
Both Python and JavaScript implementations come with a CLI that can be used to generate stable JSON and hashes.
JSON='{"B":2,"C":[1,2,3],"A":1}'
[ $(crosshash-js --hash "$JSON") == $(crosshash-py --hash "$JSON") ] && echo 'It’s a match!'
[ $(crosshash-js --json "$JSON") == $(crosshash-py --json "$JSON") ] && echo 'It’s a match!'
from crosshash import crossjson, crosshash, CrossHashError, MAX_SAFE_INTEGER
obj = {'B': 2, 'C': [1, 2, 3], 'A': 1}
# Generate stable JSON:
assert crossjson(obj) == '{"A":1,"B":2,"C":[1,2,3]}'
# Generate stable hash:
assert crosshash(obj) == '12982c60a9a8829ea4eeb2e1e7e1e04e'
# Throws `CrossHashError`:
crosshash({'A': MAX_SAFE_INTEGER + 1})
You can invoke crosshash.py
directly or use python -m crosshash
. The package also installs an executable called crosshash-py
.
$ crosshash-py --json '{"B": 2, "C": [1, 2, 3], "A": 1}'
{"A":1,"B":2,"C":[1,2,3]}
$ crosshash-py --hash '{"B": 2, "C": [1, 2, 3], "A": 1}'
12982c60a9a8829ea4eeb2e1e7e1e04e
The library runs in the browser and Node.js and comes with TypeScript definitions.
const {crossjson, crosshash, CrossHashError} = require('crosshash')
const obj = {B: 2, C: [1, 2, 3], A: 1}
// Generate stable JSON:
assert(crossjson(obj) === '{"A":1,"B":2,"C":[1,2,3]}')
// Generate stable hash:
assert(crosshash(obj) === '12982c60a9a8829ea4eeb2e1e7e1e04e')
// Throws `CrossHashError`:
crosshash({A: Number.MAX_SAFE_INTEGER + 1})
You can invoke crosshash.js
directly or using npx
. The package also installs an executable called crosshash-js
.
$ crosshash-js --json '{"B": 2, "C": [1, 2, 3], "A": 1}'
{"A":1,"B":2,"C":[1,2,3]}
$ crosshash-js --hash '{"B": 2, "C": [1, 2, 3], "A": 1}'
12982c60a9a8829ea4eeb2e1e7e1e04e
To ensure consistency, the test suite invokes the Python and JavaScript implementations of crossjson()
and crosshash()
on the same data and compares the results.
It should be fairly straightforward to add support for other languages.
git clone git@github.com:httpie/crosshash.git
cd ./crosshash
make install
make test
FAQs
Stable, cross-platform JSON serialization and hashing for Python and JavaScript.
We found that crosshash demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.