# Hexa to text node converter

**URL:** <https://discourse.nodered.org/t/hexa-to-text-node-converter/21034>\
**Category:** General\
**Created:** [30 January 2020 12:51 UTC](https://discourse.nodered.org/t/hexa-to-text-node-converter/21034 "2020-01-30T12:51:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris35](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@chris35](https://discourse.nodered.org/u/chris35)\
**Post date:** [30 January 2020 12:51 UTC](https://discourse.nodered.org/t/hexa-to-text-node-converter/21034/1 "2020-01-30T12:51:28Z")

</div>

Hello , is there a node or a method to transform hex to text like this :

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/1/f1662f043552ca254a4aeab7d08e47b29f929c40.png)

Thanks  
Chris

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [30 January 2020 13:04 UTC](https://discourse.nodered.org/t/hexa-to-text-node-converter/21034/2 "2020-01-30T13:04:58Z")

</div>

Have a look at NodeJS Buffers, especially the `Buffer.from(string[, encoding])` method:

[https://nodejs.org/dist/latest-v10.x/docs/api/buffer.html#buffer\_class\_method\_buffer\_from\_string\_encoding](https://nodejs.org/dist/latest-v10.x/docs/api/buffer.html#buffer_class_method_buffer_from_string_encoding)

You can use a function node for that.

---

<div class="post-metadata">

**Author:** ![chris35](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@chris35](https://discourse.nodered.org/u/chris35)\
**Post date:** [30 January 2020 13:44 UTC](https://discourse.nodered.org/t/hexa-to-text-node-converter/21034/3 "2020-01-30T13:44:53Z")

</div>

thanks for your answer  
I'm a newbie  
I made a edit function node like this and the result is the same as the entry  
'hexa' is no good what is the term I've to put to have '23.00/38.00/161.00'

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/b/cb37dfc94bd7140d46a6026ac4f70917f5e9e732.png)

---

<div class="post-metadata">

**Author:** ![kuema](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/kuema/32/6542_2.png) [@kuema](https://discourse.nodered.org/u/kuema)\
**Post date:** [30 January 2020 13:55 UTC](https://discourse.nodered.org/t/hexa-to-text-node-converter/21034/4 "2020-01-30T13:55:28Z")

</div>

Assuming you pass the hex-string as `msg.payload` the following could work:

```auto
msg.payload = Buffer.from(msg.payload, 'hex').toString();
return msg;

```

You were missing the Buffer part from the link I gave you.

---

<div class="post-metadata">

**Author:** ![chris35](https://avatars.discourse-cdn.com/v4/letter/c/898d66/32.png) [@chris35](https://discourse.nodered.org/u/chris35)\
**Post date:** [30 January 2020 13:59 UTC](https://discourse.nodered.org/t/hexa-to-text-node-converter/21034/5 "2020-01-30T13:59:17Z")

</div>

thank you  
it is working now 🙂

---

<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:** [13 February 2020 14:04 UTC](https://discourse.nodered.org/t/hexa-to-text-node-converter/21034/6 "2020-02-13T14:04:52Z")

</div>

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