If all you are trying to do is save the database space, think about it.
In MySQL, you may have a field of type UNSIGNED BIGINT . The maximum size of this field is 18446744073709551615, and the storage space is only 8 bytes.
If you were to convert this number (1,484 x 10 ^ 19) to base-62, it would be represented as LygHa16AHYF . To store the converted number, you will need CHAR(11) (11 bytes) or VARCHAR(11) (12 bytes).
If you used VARCHAR for a field type, smaller numbers would take up less space, but for larger numbers it really takes more. 8 bytes for a huge number are pretty minimal anyway. I would save all my efforts and just make the database field UNSIGNED BIGINT .
source share