MCPcopy Index your code
hub / github.com/tensorflow/tfjs-examples / hashCode

Function hashCode

lstm-text-generation/ui.js:258–264  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

256 }
257
258 function hashCode(str) {
259 let hash = 5381, i = str.length;
260 while (i) {
261 hash = (hash * 33) ^ str.charCodeAt(--i);
262 }
263 return hash >>> 0;
264 }
265
266 /**
267 * Initialize UI state.

Callers 1

setUpUIFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected