Skip to content

Instantly share code, notes, and snippets.

Fendi Septiawan fendiseptiawan0709

Block or report user

Report or block fendiseptiawan0709

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fendiseptiawan0709
fendiseptiawan0709 / cryptographically_secure_random_strings.php
Created Oct 22, 2018 — forked from raveren/cryptographically_secure_random_strings.php
Generate cryptographically secure random strings. Based on Kohana's Text::random() method and this answer:http://stackoverflow.com/a/13733588/179104
View cryptographically_secure_random_strings.php
function random_text( $type = 'alnum', $length = 8 )
{
switch ( $type ) {
case 'alnum':
$pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
case 'alpha':
$pool = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
break;
case 'hexdec':
You can’t perform that action at this time.