T
T
Triglav772020-01-09 14:23:19
PHP
Triglav77, 2020-01-09 14:23:19

How to convert binary to string?

There is data in the clickhouse that is stored in FixedString(6)
the string looks like this (&(): 5e170c4e78ffe771715600.png
in theory, if I use bin2hex, then 6 bytes should turn into 12 bytes (hexadecimal)
but in fact all values ​​are different. Could be 6, 7 , 8, 10 and 12 bytes After all, the data is 6 bytes
What could be the reason for this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry, 2019-03-19
@Compolomus

Parsing is very easy to parallel, look for articles on Habré about pcntl, shmop

A
Anton Shamanov, 2019-03-19
@SilenceOfWinter

Because they have different hardware and loads, and data volumes.
Try adding the header "Accept-Encoding: gzip" - perhaps compressed data transfer is available.
Unpacking the result:
if xml parsing is not regexp, but through simplexml, then it is better to set options - LIBXML_COMPACT | LIBXML_NONET | LIBXML_NOCDATA

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question