# Base64 to Hex using C# plugin

**URL:** <https://community.linx.software/community/t/base64-to-hex-using-c-plugin/615>\
**Category:** Uncategorized\
**Created:** [June 6, 2022, 1:30pm UTC](https://community.linx.software/community/t/base64-to-hex-using-c-plugin/615 "2022-06-06T13:30:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dawie\_Botes](https://community.linx.software/community/user_avatar/community.linx.software/dawie_botes/32/288_2.png) [@Dawie\_Botes](https://community.linx.software/community/u/Dawie_Botes)\
**Post date:** [June 6, 2022, 1:30pm UTC](https://community.linx.software/community/t/base64-to-hex-using-c-plugin/615/1 "2022-06-06T13:30:15Z")

</div>

When viewing Binary values, one of the most common ways to show it is Hexadecimal Code. It’s basically a code for each binary character starting from 0 to 9, and then a to z, consisting of 2 values per code. This is very often used for colour codes on websites. Colour codes are RGB (Red, Green, Blue) and the value is given like this: #000000 (0 Red, 0 Green, 0 Blue) for black, #ffffff for white (255 Red, 255 Green, 255 Blue). And any combination thereof to create the colour pallet.

However, in Linx when we use Binary, we normally talk about a List of bytes (List), which can also be converter to a Base64 string. This List closely resembles the numbered values above, so the value for the colour white would be [255,255,255].

But, in many cases we still need the Hex value. To get this, you can use the C# plugin in Linx and use this bit of code in it to convert a Base64 string to a Hex string:

> string Function(string b64)  
> {  
> byte bytes = Convert.FromBase64String(b64);  
> string hex = BitConverter.ToString(bytes);  
> return hex;  
> }

So, if you’ve got a word “White” then these would be it’s different values:

String: “White”  
List: [87,104,105,116,101]  
Baase64: V2hpdGU=  
Hex: 57-68-69-74-65
