Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Readme
Epic binary parser/serializer
Inspired by superstruct.
This library can work thanks to the fact that JavaScript stores the definition order for string
object property keys:
The order is guaranteed since ES2015.
import { struct, uint16, uint32 } from 'ebin';
const testStruct = struct({
test1: uint16(),
test2: uint16(),
test3: uint32(),
});
testStruct.serialize({ test1: 1, test2: 1, test3: 1 });
// => Uint8Array([0, 1, 0, 1, 0, 0, 0, 1])
testStruct.parse(new Uint8Array([0, 1, 0, 1, 0, 0, 0, 1]));
// => { test1: 1, test2: 1, test3: 1 }
More examples: ./examples
When using 16/32/64-bit values .bigEndian()
and .littleEndian()
functions are available to specify byte order.
Default byte order is big-endian (or inherited from parent struct
if defined there).
This section is updated manually and may not reflect the current performance.
Last updated on: 2023-11-07
Benchmarks are ran using vitest.
✓ parse.bench.ts (7) 4289ms
name hz min max mean p75 p99 p995 p999 rme samples
· hand-written - Buffer 38,073.37 0.0224 1.1365 0.0263 0.0256 0.0514 0.1000 0.1537 ±0.66% 19037
· hand-written - DataView 83,900.11 0.0085 0.3170 0.0119 0.0113 0.0237 0.0350 0.1705 ±0.83% 41952
· ebin 9,045.28 0.1015 0.3712 0.1106 0.1112 0.1335 0.2404 0.3269 ±0.37% 4523
· binparse 89,955.43 0.0086 0.2916 0.0111 0.0107 0.0180 0.0257 0.1475 ±0.75% 44978 fastest
· binary-parser 83,574.26 0.0092 0.2642 0.0120 0.0116 0.0187 0.0988 0.1394 ±0.67% 41788
· destruct-js 478.33 1.9740 2.9790 2.0906 2.0833 2.4716 2.9475 2.9790 ±0.65% 240 slowest
· structron 4,134.37 0.2169 1.7895 0.2419 0.2454 0.4206 0.4521 0.6487 ±0.86% 2068
✓ serialize.bench.ts (6) 3986ms
name hz min max mean p75 p99 p995 p999 rme samples
· hand-written - Buffer 30,164.39 0.0302 2.4920 0.0332 0.0335 0.0576 0.0617 0.0735 ±1.27% 15083
· hand-written - DataView 117,527.08 0.0069 0.9560 0.0085 0.0083 0.0165 0.0188 0.0269 ±0.48% 58764 fastest
· ebin 13,667.18 0.0661 0.3482 0.0732 0.0699 0.1359 0.1464 0.2088 ±0.48% 6834
· binary-parser-encoder 10,818.21 0.0814 2.5627 0.0924 0.0911 0.1276 0.1642 1.0452 ±1.87% 5410
· destruct-js 21.3463 45.4628 50.0825 46.8466 47.7370 50.0825 50.0825 50.0825 ±1.88% 11 slowest
· structron 3,792.20 0.2457 0.5219 0.2637 0.2617 0.4193 0.4495 0.5097 ±0.46% 1897
FAQs
Epic binary parser/serializer
The npm package ebin receives a total of 1 weekly downloads. As such, ebin popularity was classified as not popular.
We found that ebin 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
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.