# Base64 to hex function

**URL:** https://discourse.nodered.org/t/base64-to-hex-function/35453
**Category:** General
**Created:** [6 November 2020 14:49 UTC](https://discourse.nodered.org/t/base64-to-hex-function/35453 "2020-11-06T14:49:16Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![timar.zoltan](https://avatars.discourse-cdn.com/v4/letter/t/2bfe46/32.png) [@timar.zoltan](https://discourse.nodered.org/u/timar.zoltan)
#### Post date: [6 November 2020 14:49 UTC](https://discourse.nodered.org/t/base64-to-hex-function/35453/1 "2020-11-06T14:49:17Z")

</div>

Hi.  
I have a problem with a base 64 conversion. This is the original message AwAE+wABILI= in base64. This message in hex looks 030004FB000120B2. I would like to bulid this is node-red. From this code i need the 04FB it's a temperature and the last four character 20B2 it's a device id. I tried to use the base64 node but i got this [3,0,4,251,0,1,32,178] message. I don't know how can i use it to get from 4FB the value 1275? Thank you in advice.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/104ae328b398777d333cbb8a8d924edddfa3d8c5.png)  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/38012d310a0b2a61557d499405617f7b0e3b4d3e.png)

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [6 November 2020 15:41 UTC](https://discourse.nodered.org/t/base64-to-hex-function/35453/2 "2020-11-06T15:41:44Z")

</div>

Hi, the buffer parser node can help with converting that data into something useble.

e.g...

 ![4xjAVBQemF](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/b/ab26af6f0f36de655b431f533d32da23eb3ddcb3.gif)

```auto
[{"id":"6b79e972.fada28","type":"inject","z":"1062d7f9.08a808","name":"base64 string","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"AwAE+wABILI=","payloadType":"str","x":850,"y":80,"wires":[["c0639572.9f2e18"]]},{"id":"c0639572.9f2e18","type":"base64","z":"1062d7f9.08a808","name":"","action":"","property":"payload","x":1020,"y":80,"wires":[["9723eb14.4e0dc8"]]},{"id":"9723eb14.4e0dc8","type":"buffer-parser","z":"1062d7f9.08a808","name":"","data":"payload","dataType":"msg","specification":"spec","specificationType":"ui","items":[{"type":"int16be","name":"item1","offset":0,"length":1,"offsetbit":0,"scale":1,"mask":""},{"type":"int16be","name":"item2","offset":2,"length":1,"offsetbit":0,"scale":1,"mask":""}],"swap1":"","swap2":"","swap3":"","swap1Type":"swap","swap2Type":"swap","swap3Type":"swap","msgProperty":"payload","msgPropertyType":"str","resultType":"keyvalue","resultTypeType":"output","multipleResult":false,"setTopic":true,"x":860,"y":140,"wires":[["796e3a62.84cab4"]]},{"id":"796e3a62.84cab4","type":"debug","z":"1062d7f9.08a808","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":1040,"y":140,"wires":[]}]

```

---

<div class="post-metadata">

### Author: ![timar.zoltan](https://avatars.discourse-cdn.com/v4/letter/t/2bfe46/32.png) [@timar.zoltan](https://discourse.nodered.org/u/timar.zoltan)
#### Post date: [13 November 2020 15:54 UTC](https://discourse.nodered.org/t/base64-to-hex-function/35453/3 "2020-11-13T15:54:42Z")

</div>

Hi. Thank for your relpy. Unfortunately in my node red the buffer-parser not the same as your buffer parser.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/5/1/51345c48db4731bb46a595339ac60725b0834a11.png) How can i configure this node?

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [13 November 2020 16:38 UTC](https://discourse.nodered.org/t/base64-to-hex-function/35453/4 "2020-11-13T16:38:00Z")

</div>

What version of node-red is that? Looks like it's either very old or broken. The byteswap boxes should be typed inputs and the bottom area should have an editable list.

---

<div class="post-metadata">

### Author: ![timar.zoltan](https://avatars.discourse-cdn.com/v4/letter/t/2bfe46/32.png) [@timar.zoltan](https://discourse.nodered.org/u/timar.zoltan)
#### Post date: [13 November 2020 16:42 UTC](https://discourse.nodered.org/t/base64-to-hex-function/35453/5 "2020-11-13T16:42:45Z")

</div>

The version is v0.18.1.

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [13 November 2020 16:45 UTC](https://discourse.nodered.org/t/base64-to-hex-function/35453/6 "2020-11-13T16:45:24Z")

</div>

That is very very old. Is it possible you can update? What is node-red running on?

---

<div class="post-metadata">

### Author: ![timar.zoltan](https://avatars.discourse-cdn.com/v4/letter/t/2bfe46/32.png) [@timar.zoltan](https://discourse.nodered.org/u/timar.zoltan)
#### Post date: [13 November 2020 16:48 UTC](https://discourse.nodered.org/t/base64-to-hex-function/35453/7 "2020-11-13T16:48:02Z")

</div>

The node-red is runnung on a Kerlink Wirnet™ iFemtoCell SPN LoRa gateway. Maybe it not possible to upgrade.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [12 January 2021 16:48 UTC](https://discourse.nodered.org/t/base64-to-hex-function/35453/8 "2021-01-12T16:48:15Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
