Answer the question
In order to leave comments, you need to log in
How to store array of bytes in database?
Hi!
On the client (js) there is an array of bytes. For example: [104,236,116,246] (4 bytes here).
You need to transfer this array to the server and store it in the database.
Converting an array to json, passing it and storing it as a string is not rational (now one 1 byte takes 3 bytes).
You can convert each byte to a UTF-8 character, for example. But I don't think it's reliable.
How to implement it correctly?
Thank you.
PS DBMS - sqlite3
Answer the question
In order to leave comments, you need to log in
Have you tried opening the docks?
sqlite.org/datatype3.html
blob. The value is a blob of data stored exactly as it was input.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question