How to use zjrJS.Doc.hashCode(anyString).
Declaration
Goal
To quickly convert any string into a hash. Based on Java's String.hashCode() via the work found here: http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/
Typical usage
Create a small identificating checksum for any string, no matter how long. The resulting hash is an integer number, save for storing in memory and databases. Not to be used for encryption. The algorithm creates a one-way hash, meaning its result cannot be converted back into its input.
Member Type
Function.
Value Type
Integer Number.
Parameters
String anyString: anything valid as a String in javascript will do.
Dependencies
zjrJS as of version 20141202t2322.
Example
We use this ourselves in web pages that use our zjrFacetEngine.
zjrJS.Doc.hashCode(String anyString);
Goal
To quickly convert any string into a hash. Based on Java's String.hashCode() via the work found here: http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/
Typical usage
Create a small identificating checksum for any string, no matter how long. The resulting hash is an integer number, save for storing in memory and databases. Not to be used for encryption. The algorithm creates a one-way hash, meaning its result cannot be converted back into its input.
Member Type
Function.
Value Type
Integer Number.
Parameters
String anyString: anything valid as a String in javascript will do.
Dependencies
zjrJS as of version 20141202t2322.
Example
<script type="text/javascript" src="zjrJS.version.js" id="zjrJS"></script>
<script type="text/javascript">/* <![CDATA[ */
var storeKey = 'filterChoice?url=' + zjrJS.Doc.hashCode(window.location),
newStoreValue = 'technology=javascript;
zjrJS.Doc.Store.set(storeKey, newStoreValue);
/* ]]> */</script>
We use this ourselves in web pages that use our zjrFacetEngine.