Home > front end >  Js how to convert database read binary data into an array?
Js how to convert database read binary data into an array?

Time:10-30

Database has a field for BLOB type of binary data storage is a lot of a floating-point number, now want to use the node from the database to read out, translates into a float array, need how to operate? My code is written, so although print is a binary number, but do not know how every 8 bytes into float!
 router. Get ('/', function (the req, res, next) {
Var SQL='SELECT data FROM client_vdata_timefft where id=19530'.
Connection. The query (SQL, function (err, result) {
If (err) {
The console. The log (' [the SELECT ERROR] -, err. Message);
return;
}
The console. The log (' -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- SELECT -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ');
The console. The log (result [0]. Data);
Var float64Array=new float64Array (result [0]. The data).
The console. The log (' -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- \ n \ n ');
Connection. The end ();
});
  • Related