Search code examples
c#data-masking

Simple Data Masking Algorithm


Is there a simple algorithm where by I can convert a numeric value to alphanumeric and reliably convert it back to the same number?

For example, 12345 converts to 00A3DF and back to 12345.


Solution

  • I assume when you say alphanumeric you mean hexadecimal. This has already been answered:

    How to convert numbers between hexadecimal and decimal in C#? C# convert integer to hex and back again