/** * Tokens no transform may touch: identifiers, credentials, hashes. * * WHAT THIS EXISTS FOR, measured before it was written. The log templater * builds its grouping shape by replacing every digit run with a placeholder, * and digit runs occur INSIDE identifiers. On a line carrying a correlation id * and an API key it produced: * * #-#-#T#:#:#Z INFO request #f#a#c#-#b#d-#e#-#a#-ffedcba# authorised with * sk-ant-api#-QmFzZTY#TG#va#luZ#NlY#JldFZhbHVlSGVy * * That is not an elision, it is CORRUPTION. The original was * `3f2a9c14-8b7d-4e56-9a01-ffedcba98765`, and what survives looks enough like * an identifier that a model may quote it back or search for it. A dropped * value is visibly missing; a shredded one is invisibly wrong, which is worse. * * HeadRoom's masks.py carries the same idea and names the same threshold: a * length floor of 20, because "normalized Shannon entropy alone cannot tell a * 40-char API key from an 8-char diverse word", matching what trufflehog and * detect-secrets use. That floor is adopted here for the same reason. * * NOT A SECRET SCANNER. The goal is not to find every credential -- it is to * stop our own transforms mangling anything that looks like an identifier a * reader might need verbatim. False positives cost a few tokens; false * negatives corrupt data. */ /** Shannon entropy in bits per character. */ export declare function entropy(value: string): number; /** * Is this token dense enough, and long enough, to be a credential? * * The length floor does the work the entropy score cannot: `password` has * respectable entropy per character and is plainly not a key, while a * forty-character base64 run is one whatever it spells. */ export declare function isSecretLike(token: string): boolean; /** * Character ranges in `text` that must survive any transform, merged and * sorted. * * Ranges rather than tokens because callers need to ask "does this match * overlap something protected", which is a position question. */ export declare function structuralRanges(text: string): Array<[number, number]>; /** Does [start, end) touch anything protected? */ export declare function overlapsStructural(ranges: readonly (readonly [number, number])[], start: number, end: number): boolean; /** Does this passage carry an identifier or credential at all? */ export declare function containsStructural(text: string): boolean; //# sourceMappingURL=structural.d.ts.map