
Research
PyPI Package Disguised as Instagram Growth Tool Harvests User Credentials
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
compressed-json
Advanced tools
String base JSON compressor
If you seriously want to reduce your data size, consider using msgpack.
Use compressed-json only if you cannot handle binary for some reason.
npm i compressed-json
'use strict'
const cjson = require('compressed-json')
// Convert json object
const compressed = cjson.compress({ /* Large json */ })
const restored = cjson.decompress(compressed)
// Convert json string
const compressedString = cjson.compress.toString({ /* Some large json */ })
const restoredFromString = cjson.decompress.fromString(compressedString)
compressed-json has two logics:
example-src.json
{
"description": "This is example json",
"entities": [
{
"id": 100,
"name": "Dog",
"desc": "This is desc of dog",
"tag": ["animal"]
},
{
"id": 101,
"name": "Cat",
"desc": "This is desc of cat",
"tag": ["animal"]
}
],
"notes": [
"Unique string will be kept as is",
"Duplicated string will be combined",
"Duplicated string will be combined",
"p: string start with 'p:' will be escaped "
]
}
example-compressed.json
{
"_": {
"0": "This is example json",
"1": [
{
"2": 100,
"3": "Dog",
"4": "This is desc of dog",
"5": [
"p:0"
]
},
{
"2": 101,
"3": "Cat",
"4": "This is desc of cat",
"5": [
"p:0"
]
}
],
"6": [
"Unique string will be kept as is",
"p:1",
"p:1",
"e:p: string start with 'p:' will be escaped "
]
},
"K": [
"description",
"entities",
"id",
"name",
"desc",
"tag",
"notes"
],
"P": [
"animal",
"Duplicated string will be combined"
]
}
Key | Description |
---|---|
K | Array of original keys. Object keys are replaced with index of K in the compressed json |
P | Pointed string values. Values are replaced with index of P in the compressed json |
_ | Compressed payload. Keeps original structure, but keys and values may be replaced with pointers to K or P |
All object keys are replaced with index of array stored in K
of compressed JSON.
The more same key appears in original json, the more better compression.
String values appeared at least two will replaced with pointer string with contains index of array stored in P
of compressed JSON.
The more same string value appears in original json, the more better compression.
FAQs
String base JSON compressor
The npm package compressed-json receives a total of 3,170 weekly downloads. As such, compressed-json popularity was classified as popular.
We found that compressed-json demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
A deceptive PyPI package posing as an Instagram growth tool collects user credentials and sends them to third-party bot services.
Product
Socket now supports pylock.toml, enabling secure, reproducible Python builds with advanced scanning and full alignment with PEP 751's new standard.
Security News
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.