Code to improve error message display (prevent repeats, log to console dev errors instead of alert box)
This commit is contained in:
@@ -94,6 +94,23 @@ export default {
|
||||
// //No longer than 255 characters
|
||||
// inObj = StringUtil.MaxLength(inObj, 255);
|
||||
// return inObj;
|
||||
},
|
||||
///////////////////////////////
|
||||
// Quick hash for trivial purposes
|
||||
// not cryptographic
|
||||
// https://stackoverflow.com/a/7616484/8939
|
||||
//
|
||||
quickHash: function(theString) {
|
||||
var hash = 0,
|
||||
i,
|
||||
chr;
|
||||
if (theString.length === 0) return hash;
|
||||
for (i = 0; i < theString.length; i++) {
|
||||
chr = theString.charCodeAt(i);
|
||||
hash = (hash << 5) - hash + chr;
|
||||
hash |= 0; // Convert to 32bit integer
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
//new functions above here
|
||||
|
||||
Reference in New Issue
Block a user