MCPcopy Index your code
hub / github.com/markmap/markmap / simpleHash

Function simpleHash

packages/markmap-view/src/util.ts:66–72  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

64 * Credit: https://gist.github.com/jlevy/c246006675becc446360a798e2b2d781?permalink_comment_id=4738050#gistcomment-4738050
65 */
66export function simpleHash(str: string) {
67 let hash = 0;
68 for (let i = 0; i < str.length; i++) {
69 hash = ((hash << 5) - hash + str.charCodeAt(i)) | 0;
70 }
71 return (hash >>> 0).toString(36);
72}
73
74export function childSelector<T extends Element>(
75 filter?: string | ((el: T) => boolean),

Callers 1

_initializeDataMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected