MCPcopy Create free account
hub / github.com/codecombat/codecombat / hashString

Function hashString

app/core/utils.js:65–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63const anonymizingUser = function (user) {
64 const id = (user != null ? user.id : undefined) != null ? (user != null ? user.id : undefined) : user
65 const hashString = str => // hash * 33 + c
66 (__range__(0, str.length, false).map((i) => str.charCodeAt(i))).reduce((hash, char) => ((hash << 5) + hash) + char, 5381)
67 return $.i18n.t('general.player') + ' ' + (Math.abs(hashString(id)) % 10000)
68}
69

Callers 1

anonymizingUserFunction · 0.70

Calls 1

__range__Function · 0.70

Tested by

no test coverage detected