3

I need to identify an entity using a 12-characters length string, containing only digits and letters (case insensitive) and I want to squeeze the max number of possible key values.

I.E. JH45KJ2H2313

I know that I can use hex encoding (0-9, A-F, 4 bits per char => 2^48 values) I think I have to exclude base64 because it includes 2 extra chars (+ and / usually).

I think there is a better way of using the space. I.e. if 1 use 0-9 + AZ I can store 36 values ~ 4 bits in a char.

Is there an encoding standard or I need to implement the encoding/decoding myself?

Stefano Altieri
  • 4,550
  • 1
  • 24
  • 41
  • 1
    See http://codereview.stackexchange.com/questions/14084/base-36-encoding-of-a-byte-array – Rotem Feb 21 '14 at 09:09
  • 1
    And http://stackoverflow.com/questions/7398465/how-to-convert-a-byte-array-md5-hash-into-a-string-36-chars – Rotem Feb 21 '14 at 09:30

1 Answers1

1

The short answer: There is no Base36 implementation in the BCL. You have to do it by yourself or get it from elsewhere.

Georg
  • 5,626
  • 1
  • 23
  • 44