Skip to content

Instantly share code, notes, and snippets.

View inda5th's full-sized avatar

Justin Goods inda5th

View GitHub Profile
@inda5th
inda5th / generate_random_key.php
Last active March 8, 2021 01:47
Generate a random key to be used based on a specified hashing algorithm.
<?php
/**
* Generate a random key
*
* Generate a random key based on the specified hashing algorithm and given length.
* The algorithm defaults to "sha256" and the length defaults to 1024.
* See PHP's hash_algos() function for a list of supported hashing algorithms.
*
* @param string $algo The hashing algorithm to use
* @param int $length Length of desired string of bytes to create the hash
@inda5th
inda5th / states_array.php
Created September 25, 2012 00:30
PHP array of US States
$config = array('AL' => "Alabama",
'AK' => "Alaska",
'AZ' => "Arizona",
'AR' => "Arkansas",
'CA' => "California",
'CO' => "Colorado",
'CT' => "Connecticut",
'DE' => "Delaware",
'DC' => "District Of Columbia",
'FL' => "Florida",