如何将 google 数据存储格式转换为 integer/number

How to convert google datastore format to integer/number

如何将 google 数据存储中存储的数据转换为其原始数字格式?

目前正在通过 IoT 将数据保存到 google 数据存储,其中原始数据如下所示:

CO2 438 gm3 3/18/19 at 10:13:48 am

CO2 436 gm3 3/18/19 at 10:12:43 am

CO2 438 gm3 3/18/19 at 10:11:38 am

CO2 438 gm3 3/18/19 at 10:10:33 am

CO2 439 gm3 3/18/19 at 10:09:28 am

CO2 440 gm3 3/18/19 at 10:08:23 am

并且 Pub/sub 数据结构看起来像

 { gc_pub_sub_id: '312422947136384',

  device_id: '38001c000851363136363935',

  event: 'CO2',

  **data: <Buffer 34 34 32>,**

  published_at: '2019-03-18T09:14:53.711Z' }

最终数据看起来像

id=5639047607222272     NDQz    38001c000851363136363935    CO2     312423130805644     2019-03-18T09:15:58.764Z    

id=5069056390463488     NDQy    38001c000851363136363935    CO2     312422947136384     2019-03-18T09:14:53.711Z 

..

所以数据即 438 被转换为 NDQz。我的问题是,如何将 NDQz 转换为其原始数字格式 438?

格式为Base64,存储的数据能够转换为原始数字格式。