strutil

package
v1.64.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package strutil provides small string utilities shared across packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommonPrefixLen

func CommonPrefixLen(a, b string) int

CommonPrefixLen returns the length of the longest common byte prefix of a and b.

func RepoKey

func RepoKey(repoPath string) string

RepoKey produces a stable repo identifier from a repo path using FNV-32a. Format: code_<8-char-hex>, e.g. "code_a3f2b1c0". Used as a prometheus label for per-repo metrics (implementsEdgesTotal, etc.) and as the AGE graph name. Shared between codegraph.GraphNameFor and callgraph.extractGoImplements so both produce the same key for the same repo without a cross-package import.

func TextHash

func TextHash(text string) uint64

TextHash computes an FNV-64a hash of text.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL