Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.43 KB | None | 0 0
  1. $arr = array ('asfsdg','t3hbwed','gwefa@','43fsd4');
  2. $string = $arr[array_rand($arr)];
  3.  
  4. a, b, ab, ba, aa, bb
  5.  
  6. a, b, 1, ab1, 1ab, ba1, etc ...
  7.  
  8. 1ad@cb2#
  9.  
  10. function getToken($length = 10) {
  11. $alphanum = str_split('abcdefghijklmnopqrstuvwxyz0123456789-_',1);
  12. $token = '';
  13. while (strlen($token) <= $length) {
  14. $token .= $alphanum[array_rand($alphanum)];
  15. }
  16. return $token;
  17. }
  18.  
  19. function getTokens($length = 10, $count = 3) {
  20. $alphanum = str_split('abcdefghijklmnopqrstuvwxyz0123456789-_',1);
  21. $output = array();
  22. while (count($output) <= $count) {
  23. $token = '';
  24. while (strlen($token) <= $length) {
  25. $token .= $alphanum[array_rand($alphanum)];
  26. }
  27. if (!in_array($output,$token)) {
  28. $output[] = $token;
  29. }
  30. }
  31. return $output;
  32. }
  33.  
  34. <?php
  35.  
  36. echo 's'.date('Ymdhis').'<br>';
  37. echo 's'.time('his');
  38.  
  39. ?>
  40.  
  41. bin2hex(openssl_random_pseudo_bytes(256))
  42.  
  43. 49f82a54d8015699bef300c7e6e2f9307b235def885c88d35b4251dc3a6033e9d4560ff241c7afdb5a409cb267f4ee1455930381c018fd52515266f1b85ea618362355c878070509909b46af6d0338ba550a2308183fcac9e64ea87c7e3d0cf68cd9e0ebd1bb6aaf1f78fd9ee38083c32131354ed3585ad2fde8d101ddfd021e0d97ef9da0739ad92ac7cf50ae77aae408939fe84009a1e856e3bc68aeeca7908f5d8686187d712a1c0995cba63fb77ded7d9767dddd056bfba550a24235b78e26e8447a537cd426dd923649f2c293f6cf07154aae599dda07b6814c3c842acc15be33ea20b4dcfde543f2849261d5b44ed5d4c102043c0b26f00e55d17f0622
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement