Title: bug on simple parsing? · Issue #18 · PMunch/binaryparse · GitHub
Open Graph Title: bug on simple parsing? · Issue #18 · PMunch/binaryparse
X Title: bug on simple parsing? · Issue #18 · PMunch/binaryparse
Description: ran into it while trying this library for today's aoc: import binaryparse, streams block: let test1 = newStringStream("\xD2\xFE\x28") createParser(packet): u3: version u3: typeId var data = packet.get(test1) dump data outputs: data = (ve...
Open Graph Description: ran into it while trying this library for today's aoc: import binaryparse, streams block: let test1 = newStringStream("\xD2\xFE\x28") createParser(packet): u3: version u3: typeId var data = packet....
X Description: ran into it while trying this library for today's aoc: import binaryparse, streams block: let test1 = newStringStream("\xD2\xFE\x28") createParser(packet): u3: version u3: typeId var ...
Opengraph URL: https://github.com/PMunch/binaryparse/issues/18
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug on simple parsing?","articleBody":"ran into it while trying this library for [today's aoc](https://adventofcode.com/2021/day/16):\r\n\r\n```\r\nimport binaryparse, streams\r\n\r\nblock:\r\n let test1 = newStringStream(\"\\xD2\\xFE\\x28\")\r\n\r\n createParser(packet):\r\n u3: version\r\n u3: typeId\r\n \r\n var data = packet.get(test1)\r\n dump data\r\n```\r\n\r\noutputs:\r\n\r\n```\r\ndata = (version: 6, typeId: 7)\r\n```\r\n\r\n but typeId should be 4.\r\n\r\nFor comparison [binarylang](https://github.com/sealmove/binarylang) has the correct output:\r\n\r\n```\r\nimport binarylang\r\n\r\nblock:\r\n let test1 = newStringBitStream(\"\\xD2\\xFE\\x28\")\r\n\r\n struct(packet):\r\n u3: version\r\n u3: typeId\r\n\r\n var data = packet.get(test1)\r\n # data is an object without a $ proc defined\r\n echo data.version\r\n echo data.typeId\r\n```\r\noutputs:\r\n```\r\n6\r\n4\r\n```\r\n","author":{"url":"https://github.com/pietroppeter","@type":"Person","name":"pietroppeter"},"datePublished":"2021-12-16T17:52:21Z","url":"https://github.com/PMunch/binaryparse/issues/18"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:439407c7-16ad-3dc5-7235-578bc6a04bc2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A914:2E5888:24A040:30860D:6B07C6D9 |
| html-safe-nonce | 4a2a451f895b4e22057896db74250a6ecc2983fbeeda73a35c99d9dfe4730f83 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOTE0OjJFNTg4ODoyNEEwNDA6MzA4NjBEOjZCMDdDNkQ5IiwidmlzaXRvcl9pZCI6IjM3OTE0MTQ1ODE3MDk0ODk4ODEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 48f90f855ecc5d56d8dcd34b15b3489ccb2da5d8e8bbc14b3dbd1dbef3878712 |
| hovercard-subject-tag | issue:1082484731 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PMunch/binaryparse/18/issue_layout |
| twitter:image | https://opengraph.githubassets.com/3f57b120ab53074f1ddc96787a4a33a7c04463b350d060ec84c581ff9a30876f/PMunch/binaryparse/issues/18 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/3f57b120ab53074f1ddc96787a4a33a7c04463b350d060ec84c581ff9a30876f/PMunch/binaryparse/issues/18 |
| og:image:alt | ran into it while trying this library for today's aoc: import binaryparse, streams block: let test1 = newStringStream("\xD2\xFE\x28") createParser(packet): u3: version u3: typeId var data = packet.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pietroppeter |
| hostname | github.com |
| expected-hostname | github.com |
| None | 176c580172ff5ad9b9613f91a521417cd790cd3d786513ed70487aa605a0c30d |
| turbo-cache-control | no-preview |
| go-import | github.com/PMunch/binaryparse git https://github.com/PMunch/binaryparse.git |
| octolytics-dimension-user_id | 2845482 |
| octolytics-dimension-user_login | PMunch |
| octolytics-dimension-repository_id | 113347009 |
| octolytics-dimension-repository_nwo | PMunch/binaryparse |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 113347009 |
| octolytics-dimension-repository_network_root_nwo | PMunch/binaryparse |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f7ea8487ffe46a9751a27e4977b6cd2f853125f2 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width