A javascript implementation of yEnc, usable for node and browsers
yEnc is an encoding method which offers efficient and proper transmission for binaries on the Usenet (or by eMail and other applications).
Other encodings are BASE64, BinHex, UUencode, Quoted Printable, …
yEnc is NOT an audio format (as MP3) or a video format (as AVI, MOV, …) or a picture format (as GIF or JPEG).
This library includes a benchmark suite (npm run bench
) using tinybench to measure encode/decode performance for ASCII, Unicode, and large strings.
bench.ts
and can be run with npm run bench
.Operation | Before Optimization | After Optimization | Change |
---|---|---|---|
encode (ascii) | 939,753 ops/sec | 949,856 ops/sec | +1% |
decode (ascii) | 3,131,047 ops/sec | 3,193,687 ops/sec | +2% |
encode (unicode) | 881,131 ops/sec | 911,317 ops/sec | +3% |
decode (unicode) | 2,583,784 ops/sec | 2,674,569 ops/sec | +4% |
encode (large) | 2,276 ops/sec | 2,382 ops/sec | +5% |
decode (large) | 6,857 ops/sec | 6,972 ops/sec | +2% |
Key optimizations:
How to run benchmarks:
npm run bench
Interpretation:
npm test
).