Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,
I need to convert an 8 bit string to a 6 bit string.
Unfortunately I don't have the knowledge or understanding (yet) how to realize such a conversion. Therefore I don't want a solution but how to do it. I would be very grateful for any help. I have to realize the whole thing with C#. The data is data from a RFID string, so in hex

What I have tried:

I have already searched for sources that have the mathematical background but unfortunately found nothing. Know me in the field unfortunately not yet at all from
Posted
Updated 17-Apr-23 9:56am
v2
Comments
PIEBALDconsult 17-Apr-23 14:49pm    
I have no idea what concept you are trying to convey. I'm hoping you mean 16 bit. What makes you think you need 6 bits?
Use the Improve question button to edit your question to add detail and clarity. Maybe an example of input and output.
0x01AA 17-Apr-23 15:15pm    
Looks more like Base64
0x01AA 17-Apr-23 15:10pm    
Do you mean Base64 Encoding/Decoding?

c# string to Base64: Convert.ToBase64String Methode (System) | Microsoft Learn[^]

Sorry, here the link for the English version:
Convert.ToBase64String Method (System) | Microsoft Learn[^]

1 solution

As already suggested, have a look at Base64[^]. You should have no problems in grasping the idea behind and, if necessary, adapt it to your needs.
 
Share this answer
 
Comments
0x01AA 17-Apr-23 16:01pm    
+5
CPallini 17-Apr-23 16:18pm    
I've actually stolen your answer. :-D
Thank you!
0x01AA 17-Apr-23 16:30pm    
No, no. You gave the correct background info ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900