symfony - nelmio/alice random string with specified long -


i trying find way generate random unique string 8 characters long using nelmio/alice.

and i've found <uuid()> (token (unique): <uuid()>)method, unfortunately returns long string, need 8 characters.

may 1 knows elegant solution?

thanks i've found solution

token (unique): '<( substr( md5( uniqid( rand(), true ) ) , 0, 8) )>' 

Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -