(s, convert)
| 3456 | }; |
| 3457 | |
| 3458 | function string_hash(s, convert) { |
| 3459 | var hash = 0; |
| 3460 | if (s.length === 0) |
| 3461 | return convert ? '' : hash; |
| 3462 | for (var i = 0, l = s.length; i < l; i++) { |
| 3463 | var char = s.charCodeAt(i); |
| 3464 | hash = ((hash << 5) - hash) + char; |
| 3465 | hash |= 0; |
| 3466 | } |
| 3467 | return hash; |
| 3468 | } |
| 3469 | |
| 3470 | SP.count = function(text) { |
| 3471 | var index = 0; |