How to generate a random, unique, alphanumeric string?

PHP 7 standard library provides the random_bytes($length) function that generate cryptographically secure pseudo-random bytes. Example: $bytes = random_bytes(20); var_dump(bin2hex($bytes)); The above example will output something similar to: string(40) “5fe69c95ed70a9869d9f9af7d8400a6673bb9ce9” More info: http://php.net/manual/en/function.random-bytes.php PHP 5 (outdated) I was just looking into how to solve this same problem, but I also want my function to create a … Read more

How unique is UUID?

Very safe: the annual risk of a given person being hit by a meteorite is estimated to be one chance in 17 billion, which means the probability is about 0.00000000006 (6 × 10−11), equivalent to the odds of creating a few tens of trillions of UUIDs in a year and having one duplicate. In other … Read more

Is there a unique Android device ID?

Settings.Secure#ANDROID_ID returns the Android ID as an unique for each user 64-bit hex string. import android.provider.Settings.Secure; private String android_id = Secure.getString(getContext().getContentResolver(), Secure.ANDROID_ID); Also read Best practices for unique identifiers: https://developer.android.com/training/articles/user-data-ids

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)