MCPcopy Create free account
hub / github.com/21st-dev/1code / hashString

Function hashString

src/renderer/components/chat-markdown-renderer.tsx:509–516  ·  view source on GitHub ↗
(str: string)

Source from the content-addressed store, hash-verified

507// Simple hash function for content-based keys
508// Using djb2 algorithm - fast and good distribution
509function hashString(str: string): string {
510 let hash = 5381
511 for (let i = 0; i < str.length; i++) {
512 hash = ((hash << 5) + hash) ^ str.charCodeAt(i)
513 }
514 // Convert to unsigned 32-bit and then to base36 for shorter keys
515 return (hash >>> 0).toString(36)
516}
517
518interface ParsedBlock {
519 content: string

Callers 1

parseIntoBlocksFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected