INNER CODE UNIT · JavaScript
bountyId
karanb192/claude-code-hooks · plugins/bounty-board/bounty-board.js:118
function bountyId(relPath, ruleId, text) {
return crypto
.createHash('sha1')
.update(`${relPath}\u0000${ruleId}\u0000${text.trim()}`)
.digest('hex')
.slice(0, 12);
}
/**
* Best-effort index of the first comment token on a line, or -1 if none.
* Recognizes: // /* # <!-- and leading * -- ; continuation/comment
* markers. `//` preceded by `:` is skipped so `https://…/TODO` never counts.
* `#!` (shebang) is skipped. Heuristic, not a parser: but it keeps TODO in
* string literals, URLs, and prose off the board.
*/
function commentStart(line) {
const candidates = [];
for (let i = line.indexOf('//'); i !== -1; i = line.indexOf('//', i + 1)) {