Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find a good way to deal with binary files #32

Open
fwcd opened this issue Dec 20, 2022 · 1 comment
Open

Find a good way to deal with binary files #32

fwcd opened this issue Dec 20, 2022 · 1 comment
Labels
enhancement New feature or request

Comments

@fwcd
Copy link
Collaborator

fwcd commented Dec 20, 2022

Currently, binary solutions aren't particularly readable:

image

I think there are some (non-mutually-exclusive) ways on how we could improve on this:

  • Detect if a file is binary. For my repo, I set the property "binary": true in the paths.json, but perhaps we could also apply heuristics, such as checking whether strange characters pop up during decoding.
  • Handle some common binary formats. For example, in the case above, the format is based on a binary plist, which we could e.g. convert to JSON and then present it. Then again, perhaps this is too niche to be useful and would impose too much complexity for an edge case?
  • Offer a download link for the binary file. This would probably be the most useful option if the user has the appropriate program installed on their device, but probably not very useful for browsing through.
  • Display the binary file in a hex editor-style. This might be fun, but probably doesn't add much value over the current ASCII view.
@fwcd fwcd added the enhancement New feature or request label Dec 20, 2022
@melfkammholz
Copy link
Owner

Detect if a file is binary. For my repo, I set the property "binary": true in the paths.json, but perhaps we could also apply heuristics, such as checking whether strange characters pop up during decoding.

The HTTP responses for binary files have the content type set to "application/octet-stream". We could use this for detection.

Handle some common binary formats. For example, in the case above, the format is based on a binary plist, which we could e.g. convert to JSON and then present it. Then again, perhaps this is too niche to be useful and would impose too much complexity for an edge case?

I am not against supporting some binary formats but it would be more manageable if the structure of the project would be more designed for that case, I guess. Maybe it is more fun to do once we migrated to React and a more suitable project structure.

Offer a download link for the binary file. This would probably be the most useful option if the user has the appropriate program installed on their device, but probably not very useful for browsing through.

I think, this is a reasonable approach for now.

Display the binary file in a hex editor-style. This might be fun, but probably doesn't add much value over the current ASCII view.

Or we could - just for fun - use the binary file as a seed for other random stuff to be displayed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants