cryptography - A shorter non-repeating alphanumeric code than UUID in MySQL -


is possible mysql database generate 5 or 6 digit code comprised of numbers , letters when insert record? if how?

just goo.gl, bit.ly , jsfiddle it. exaple:

cz6ahf, 3t5mm, xgnpn, xswuds...

so uuid_short() not work because returns value 23043966240817183

requirements:

  1. must unique (non-repeating)
  2. can not required based off of primary key integer value
  3. must scale (grow 1 character when possible combinations have been used)
  4. must random. (item 1234 cannot bcde while item 1235 bcdf)
  5. must generated on insert.

would appreciate code examples.

try this:

select left(uuid(), 6); 

Comments