MCPcopy Create free account
hub / github.com/adobe/react-spectrum / hash

Function hash

packages/@react-spectrum/s2/style/style-macro.ts:841–847  ·  view source on GitHub ↗
(v: string)

Source from the content-addressed store, hash-verified

839// djb2 hash function.
840// http://www.cse.yorku.ca/~oz/hash.html
841function hash(v: string) {
842 let hash = 5381;
843 for (let i = 0; i < v.length; i++) {
844 hash = ((hash << 5) + hash + v.charCodeAt(i)) >>> 0;
845 }
846 return hash;
847}
848
849function layerName(name: string) {
850 // All of our layers should be sub-layers of a single parent layer, so that

Callers 2

createThemeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected