Skip to content

Instantly share code, notes, and snippets.

@web-elite
Created February 19, 2022 13:24
Show Gist options
  • Save web-elite/2c88bf2e499afcdef7506d26a03ec90a to your computer and use it in GitHub Desktop.
Save web-elite/2c88bf2e499afcdef7506d26a03ec90a to your computer and use it in GitHub Desktop.
generate random hash in php in one line code
/*
* x = hash lenght
*/
substr(md5(openssl_random_pseudo_bytes(20)), $x);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment