Creating a unique URL safe hash

Posted by Ben Foster on Stack Overflow See other posts from Stack Overflow or by Ben Foster
Published on 2012-09-07T15:25:55Z Indexed on 2012/09/07 15:38 UTC
Read the original article Hit count: 243

Filed under:
|
|

I want to hash/encode a unique integer (database ID) to create a similarly unique string.

It needs to meet the following requirements:

  1. Must start with a letter or number, and can contain only letters and numbers.
  2. All letters in a container name must be lowercase.
  3. Must be from 3 through 63 characters long (although the shorter the better)

The result does not need to be reversible, just repeatable - so a 1-way hash would be fine.

© Stack Overflow or respective owner

Related posts about c#

Related posts about encryption