35 lines · 1.0 KB · TypeScript
RawDownload
import type { NativeReviewDiffHighlightScheme } from "../diffs/nativeReviewDiffHighlighter"; // Pure key-derivation helpers for the native review diff bridge. Kept free of// react-native / hook imports so they stay unit-testable in node. export function hashReviewDiffKey(diff: string | null | undefined): string {  if (!diff) {    return "empty";  }   let hash = 5381;  for (let index = 0; index < diff.length; index += 1) {    hash = (hash * 33) ^ diff.charCodeAt(index);  }   return `${diff.length}:${(hash >>> 0).toString(36)}`;} export function buildNativeReviewTokensResetKey(input: {  readonly threadKey: string | null;  readonly sectionId: string | null;  readonly scheme: NativeReviewDiffHighlightScheme;  readonly diff: string | null | undefined;  readonly fileCount: number;  readonly rowCount: number;}): string {  return [    input.threadKey ?? "none",    input.sectionId ?? "none",    input.scheme,    hashReviewDiffKey(input.diff),    input.fileCount,    input.rowCount,  ].join(":");}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t