资 源 简 介
This module was created to generate short alphanumeric ids for a discount coupon application. It can also be useful to generate shared session keys for games and any other application where you need an easy to share alphanumeric code.
It can be used as a short hash for integers, but in fact is uses a base 32 notation that has the following attributes:
Collision-free 1 to 1 mapping for positive integers
Somewhat compact: encodes 5 bit per digit
Generates a case insensitive code
Pads to a given number of digits
Does not use "L"/"l", "I"/"i" and "O","o" to avoid mistakes with "zero" and "one".
Optional Luhn mod N algorithm included for checksum digit generation
Maximum range can be calculated as 32 elevated to the number of digits used.
You can customize FW_MAP and BW_MAP to make codes harder to guess, but this algorithm was not designed to be crypto safe. In my map I made 0=A bec