hashes.com: Hashes
Warning: include(../lib/hashes_header.php3): failed to open stream: No such file or directory in /hsphere/local/home/djackson/hashes.com/misc/hashes_def.php on line 13
Warning: include(../lib/hashes_header.php3): failed to open stream: No such file or directory in /hsphere/local/home/djackson/hashes.com/misc/hashes_def.php on line 13
Warning: include(): Failed opening '../lib/hashes_header.php3' for inclusion (include_path='.:/hsphere/shared/apache/libexec/php5ext/php/') in /hsphere/local/home/djackson/hashes.com/misc/hashes_def.php on line 13
Warning: include(../lib/navColumn.php3): failed to open stream: No such file or directory in /hsphere/local/home/djackson/hashes.com/misc/hashes_def.php on line 16
Warning: include(../lib/navColumn.php3): failed to open stream: No such file or directory in /hsphere/local/home/djackson/hashes.com/misc/hashes_def.php on line 16
Warning: include(): Failed opening '../lib/navColumn.php3' for inclusion (include_path='.:/hsphere/shared/apache/libexec/php5ext/php/') in /hsphere/local/home/djackson/hashes.com/misc/hashes_def.php on line 16
What's a Hash?
A hash by any other name is still a hash.
{ "anon", "Perl" }
A hash (or "associative array") is a special type of array in which
data ("values") are indexed by strings ("keys"), rather than by the usual
numbers (0, 1, 2, etc.). Hashes are easy to learn and use -- well
worth adding to your repertoire even if you are a relatively new programmer.
Perl, PHP, and JavaScript all support hashes, but only in Perl is that
readily apparent in standard literature:
Perl defines and supports hashes explicitly (%hash; $hash{"key"}
contains the associated value).
PHP implements hashes, but confusingly calls them arrays. In PHP,
moreover, conventional arrays are implemented as hashes, which should tell
you something about the relative importance of hashes versus (conventional)
arrays in generating most Web pages.
JavaScript explicitly ignores hashes, but its objects play the same
role, implementing keys as properties (hashes.com could be coded as
hashes["com"]). Indeed, JavaScript objects are implemented as hashes,
which you probably guessed if you've followed this discussion closely.
Warning: include(../lib/hashes_trailer.php3): failed to open stream: No such file or directory in /hsphere/local/home/djackson/hashes.com/misc/hashes_def.php on line 27
Warning: include(../lib/hashes_trailer.php3): failed to open stream: No such file or directory in /hsphere/local/home/djackson/hashes.com/misc/hashes_def.php on line 27
Warning: include(): Failed opening '../lib/hashes_trailer.php3' for inclusion (include_path='.:/hsphere/shared/apache/libexec/php5ext/php/') in /hsphere/local/home/djackson/hashes.com/misc/hashes_def.php on line 27