Guest User

Untitled

a guest
Jan 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. /**
  2. * Computes a numerical signature of a string. It just sums up the charCodes of all the characters of the input string.
  3. * @param{String} ofString The string to calculate.
  4. */
  5. function getSpeedySignature (ofString) {
  6. var sum
  7. ,len
  8. ,i;
  9.  
  10. sum = 0;
  11. len = ofString.length;
  12.  
  13. for (i = 0; i < len; i++) {
  14. sum += ofString.charCodeAt(i);
  15. }
  16.  
  17. return sum;
  18. }
Add Comment
Please, Sign In to add comment