2022 Developer Survey is open! Take survey.

Questions tagged [binary]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
3 answers
99 views

Convert from decimal to binary and octal

I wrote a program that implements an algorithm that converts from decimal to binary and octal Please criticize my implementation. What else can I do to improve? ...
user avatar
  • 179
1 vote
2 answers
63 views

Reading 12-bit words from 32-bit stream

I have a device (ADC) that stores its samples in a 32-bit buffer and each sample is a 12-bit word : I needed an algorithm to read those samples to a container (say ...
user avatar
  • 771
4 votes
2 answers
961 views

Algorithm to find the sequence of bits that makes up to a given number

...
user avatar
  • 1,353
1 vote
1 answer
282 views

Float to binary conversion

I wrote a program to convert float to it's binary IEEE754 representation in C. Any improvements to this is appreciated ...
user avatar
  • 113
6 votes
4 answers
995 views

Bytes to binary conversion function

I created a quick function to convert n bytes into binary for my student. She is not on that level yet, but I think it would be best for her if my demonstrative ...
user avatar
  • 1,353
5 votes
1 answer
171 views

Binary IO inspired by struct pack

About I'm writing a header-only template library for helping with binary IO. It is inspired by pack-d, which is in turn inspired by Python's struct module. I've only finished the output part and ...
user avatar
3 votes
2 answers
228 views

How to simplify and optimize bitwise get/set operations on a large bit buffer in JavaScript?

tl;dr: How could you rewrite the buf_get and buf_set functions below to be most optimal? It took me a long time and a lot of ...
user avatar
  • 299
6 votes
1 answer
171 views

binary data shell echo generator

edit: here is a cleaned-up version incorporating most (but not all) feedback, thanks guys; https://gist.github.com/divinity76/79efd7b8c0d7849b956cd194659c98e5 edit2, 2021-07-16: found a bug (possible ...
user avatar
3 votes
1 answer
131 views

Swapping Nibbles

I have small (<250 bytes) chunk of binary data, where I know that almost always, the first nibble is going to be zero 0. For example, in hex: ...
user avatar
  • 215
1 vote
1 answer
170 views

Serializing object graph to proprietary binary file

I'm creating a class library to read/write .3di files which are binary files describing 3D models for a video game. This review is for the write/serialization process. I've mapped the different ...
user avatar