MCPcopy Create free account
hub / github.com/cmliu/CF-Workers-CheckProxyIP / indexOfBytes

Function indexOfBytes

_worker.js:5526–5536  ·  view source on GitHub ↗
(haystack, needle, start = 0)

Source from the content-addressed store, hash-verified

5524}
5525
5526function indexOfBytes(haystack, needle, start = 0) {
5527 outer: for (let i = start; i <= haystack.length - needle.length; i++) {
5528 for (let j = 0; j < needle.length; j++) {
5529 if (haystack[i + j] !== needle[j]) {
5530 continue outer;
5531 }
5532 }
5533 return i;
5534 }
5535 return -1;
5536}
5537
5538function pickExitIp(payload) {
5539 // 探针 JSON 里优先取 ip,兼容部分接口用 ipAddress 命名。

Callers 1

handleCheckProxyRequestFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected