Skip to main content
5 votes
2 answers
91 views

How do I decode a bit string representing a n-digit number, where the 'n' digits were grouped and encoded in bit words of different lengths?

Background I am trying to decode a bitstring from a QR-Code, where the data was encoded in numeric mode. According to this QR-Code tutorial: https://www.thonky.com/qr-code-tutorial/numeric-mode-...
Immanuel Neumann's user avatar
1 vote
0 answers
78 views

ProVerif error : bitstring comparison and type mismatch in XOR function

I'm using ProVerif 2.05 for modeling cryptographic protocols, but I'm running into errors when performing bitwise operations with the XOR function. The error tells me that I have a type mismatch when ...
kw33n's user avatar
  • 11
2 votes
3 answers
133 views

Bounds checking a float from only an unsigned bit string

I am trying to return the result of casting a single precision float to an int just from its bit string. I correctly grab the sign bit, exponent and mantissa from the bit string but I am unsure how to ...
tothemax's user avatar
  • 115
-1 votes
1 answer
189 views

Determine whether you can reach bitstring B from bitstring A using specific operations

The question is, given two bitstrings A and B, determine whether you can reach B from A using the following operation: Choose two indices i,j such that the values at both indices are the same, and the ...
Joseph Bendy's user avatar
2 votes
1 answer
500 views

Convert a binary string of 0s and 1s to a bitstring in elixir

Given a string such as "0110", how do I convert this to a bitstring containing the binary values represented by the string? I checked the Base module, but it's based on RFC 4648 and is not ...
Adam Millerchip's user avatar
-2 votes
1 answer
70 views

using 8-bit binary response of a hardware

I have a piece of hardware that for instance returns the "response" below. Per the instructions, I would like to separate the response to the 1st and last 4 bits. But the lower bit response ...
Deschutes's user avatar
2 votes
1 answer
47 views

Why is the first argument of child's constructor being used in parent's constructer when inheriting `bitstring.BitArray`?

I want my class to inherit the BitArray class but I'm running into a problem in the constructors. I have several positional and keyword arguments I want to use in the child but the first positional ...
bembrin's user avatar
  • 31
2 votes
2 answers
192 views

Python efficient assigning of even and odd bits to a bitstring/bit_array

I receive serialized DDR data from a setup with 8 chips. Due to the way the readout is implemented in hardware, the data that is received by the computer has the following structure: bits 0 and 1 of ...
Christian Disch's user avatar
1 vote
2 answers
1k views

How can I convert a bitstring to the binary form in Julia

I am using bitstring to perform an xor operation on the ith bit of a string: string = bitstring(string ⊻ 1 <<i) However the result will be a string, so I cannot continue with other i. So I want ...
Nikola Tolzsek's user avatar
2 votes
4 answers
531 views

Nonzero for integers

My problem is as follows. I am generating a random bitstring of size n, and need to iterate over the indices for which the random bit is 1. For example, if my random bitstring ends up being 00101, I ...
adrien_vdb's user avatar
1 vote
0 answers
32 views

Modified Zeckendorf represention

Given x as searched integer and k as minimum zeros between 2 ones. Example: x := 7,k := 0 Binary represention: 111 x := 7,k := 1 Binary represention: 1010 x := 7,k := ?(>1) Binary represention: ? ...
TTho Einthausend's user avatar
0 votes
0 answers
47 views

how to find identical bitposition in a string in python

create a circuit of 5 qubits qr = QuantumRegister(5, "qr") # quantum bit register cr = ClassicalRegister(5, "cr") # classical bit register circuit = QuantumCircuit(qr, cr) # all ...
owais ishtiaq's user avatar
1 vote
0 answers
43 views

How to find identical bitposition in a string?

I have created a sequence of bitstring. Now I want to calculate the identical bit positions all sequences one by one. I don't understand how to find it. S1: ...
owais ishtiaq's user avatar
1 vote
0 answers
3k views

How to import already installed python module "bitstring"

I'm on Windows and working on a python file from a cloned gitHub repository. When trying to do import bitstring as bs I get this error: ModuleNotFoundError: No module named 'bitstring' But "pip ...
Alessandro's user avatar
0 votes
1 answer
420 views

How do I turn a file into a RAW bitstring?

How do I read a file and turn it to a RAW bit string? For example I open an image that is 512kb, It reads the file byte by byte, and it spits out the long bit string that is the file? I would like to ...
Pedro Paulino's user avatar

15 30 50 per page
1
2 3 4 5
10