# $EPIC: hash_32bit.txt,v 1.3 2007/03/02 02:32:04 jnelson Exp $ ======Synopsis:====== $__hash_32bit__( ) ======Technical:====== * The and arguments are [[what is a word|dwords]], which is different from most function arguments. * If the argument is omitted the empty string is returned * If the argument is omitted it defaults to 0 * If the argument is a negative number of is greater than 64, it is changed to 20. * The return value of this function is a 32 bit signed integer that is a "hash" of the first characters in . * Analytically speaking, hashing is a specific type of lossy compression. * All lossy compression techniques suffer from "collisions". A collision occurs when two different s yield the same return value. If you must avoid collisions, use $[[encode]]() instead. * The inverse of this principle is that all lossy compression techniques are irreversible. You cannot take the return value of this function and determine what was. If you must be able to recreate , use $[[encode]]() instead. * The return value of this function is deterministic within the lifetime of the client. The algorithm used to compute this value is subject to change in the future; you should not "save" the return value of this function to a file for use in future versions in epic. ======Practical:====== You can use $__hash_32bit__() to convert an arbitrary string (perhaps containing characters that cannot be used in alias names) into a 32 bit signed integer value which you can use as part of an alias name. Collisions will occur. You cannot recover the original from the output of this function. Please keep these in mind when using this function. ======Returns:====== A 32 bit signed integer (it can be either negative or positive) that is deterministically derived from the first characters in . ======Examples:====== $hash_32bit("hello there") returns 51439