GMOD / cram-js

Read CRAM v3 and v2 in node or in the browser
MIT License
18 stars 9 forks source link

Remove binary-parser usage #137

Closed cmdcolin closed 2 months ago

cmdcolin commented 3 months ago

This PR replaces all usages of binary-parser with plain buffer parsing

The binary-parser package was problematic because it's use of eval triggers CSP warnings on webpages

CSP is a new method of securing webpages https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP

some small bonuses are improved typescript, and not having to maintain @gmod/binary-parser (similar work would need to be done to bbi-js and twobit-js to fully remove) and potentially faster code (not measured yet)

some small downsides are reduced readability due to manually managed byte offsets