All Questions
Tagged with binary-data string
33 questions
1
vote
2
answers
83
views
Accessing Binary form/data/array of a text file in C
My understanding is, if we run the function for the binary form of that string, it could be faster.
For example, let, a string "AAABVAVBBA" is written in a text file test.txt in the hard ...
1
vote
1
answer
28
views
Read file saved using gzip: why is the file handle a string?
I have a list of lists, let's suppose it is:
sentcorpus = [["hello", "how", "are", "you", "?"], ["hello", "I", "'m", &...
0
votes
1
answer
845
views
Converting binary to string, then back again using python
I have a string, rsastring that represents some binary data. It contains the following:
b'N(\xc8.\xd3\x1eG\xaa\xe1\xbc\xd5\x95p\x03\\\x043\x8f\x03\xad\xc6\xc5\xd9z\x19.\xf0\x9c\x07R\xaf12\xb9;\xb1w\...
0
votes
1
answer
4k
views
Python: Converting a Binary String to a Text File [duplicate]
I have written a code where I can convert the text from a text file a.txt into a binary string Binary, now I want do the reverse,
In other words, I want to convert binary string Binary into a text ...
2
votes
1
answer
296
views
Pattern matching / deconstruction of binaries and bitstrings in Haskell that's similiar to the one of Elixir/Erlang
In Elixir/Erlang one can do this kind of pattern matching / deconstruction over binaries and bitstrings:
def func1(my_data) do
<<
1,
44,
a::little-32,
b::...
-1
votes
1
answer
3k
views
Compare two binary strings consist only 0 and 1 in java, want to findout which string is lexicographically greater
this is what i am doing for comparing binary string but it is taking o(n) time in worst case. I have tried both manually and Strings compareTo method, Please help me with better approach to solve this ...
0
votes
2
answers
240
views
Convert an array of more than 64 bits to a base-10 string
I am trying to roll my own arbitrary size unsigned integer class, but I am having trouble finding a way to convert the std::vector<bool> I am using to store the bits into a base 10 string. ...
1
vote
2
answers
1k
views
How to read binary strings in Python
I am wondering how is binary encoding for a string is given in Python.
For example,
>>> b'\x25'
b'%'
or
>>>b'\xe2\x82\xac'.decode()
'€'
but
>>> b'\xy9'
File "<...
1
vote
1
answer
113
views
Concatenate binary strings obtained from decimal to binary conversion
I want to place the binary equivalent number for each element side - by side i.e, the final matrix Concatenated_A would be of size m by nbits*n where [m,n] = size(A);
A = [5, 5, 4, 10, 4;
10, ...
10
votes
3
answers
2k
views
Why are there binary safe AND binary unsafe functions in php?
Is there any reason for this behavior/implementation ?Example:
$array = array("index_of_an_array" => "value");
class Foo {
private $index_of_an_array;
function __construct() {}
}
$foo = ...
0
votes
3
answers
2k
views
Convert binary hex data to ASCII equivalent and store in String
I am using C++ on Arduino.
Suppose I have a stream of binary data;
binary data: 0xFF, 0x00, 0x01, 0xCC
I want to convert it to the ASCII equivalent and store it in a String object type.
The ...
1
vote
0
answers
133
views
Search substring in binary file
friends! Please, help me with my issue. I have an application which processes data and generates output files (different formats, but mostly images). In every generated file that application puts it's ...
-2
votes
1
answer
1k
views
Concatenating string and binary data in python
My goal is to write mongo queries where id is binary. I have hexadecimal data which is converted to binary string and fed to query.
my code:
b=binascii.a2b_hexdata('#hexadecimal string#')
query=...
2
votes
3
answers
1k
views
How to convert specific bytes from binary file into string most efficiently
So I have binary FRX files, from which I need to extract strings into Java.
I wrote this into my Java program like so:
FileInputStream ReadFRX = null ;
FileOutputStream TempCapt = null ;
try{ ...
1
vote
3
answers
2k
views
Convert string stored as binary back to string
I have stored string as binary data in db.
I am loading this data into c# as byte[]. How do I convert it to original string there?
declare @QRCodeLink nvarchar(max) = 'goo.gl/JCKW'
declare @...