MCPcopy
hub / github.com/di-sukharev/opencommit / findTheIPv6AddressCompressedPieceIndex

Function findTheIPv6AddressCompressedPieceIndex

out/cli.cjs:3901–3925  ·  view source on GitHub ↗
(address)

Source from the content-addressed store, hash-verified

3899 return utf8PercentEncodeString(input, isC0ControlPercentEncode);
3900 }
3901 function findTheIPv6AddressCompressedPieceIndex(address) {
3902 let longestIndex = null;
3903 let longestSize = 1;
3904 let foundIndex = null;
3905 let foundSize = 0;
3906 for (let pieceIndex = 0; pieceIndex < address.length; ++pieceIndex) {
3907 if (address[pieceIndex] !== 0) {
3908 if (foundSize > longestSize) {
3909 longestIndex = foundIndex;
3910 longestSize = foundSize;
3911 }
3912 foundIndex = null;
3913 foundSize = 0;
3914 } else {
3915 if (foundIndex === null) {
3916 foundIndex = pieceIndex;
3917 }
3918 ++foundSize;
3919 }
3920 }
3921 if (foundSize > longestSize) {
3922 return foundIndex;
3923 }
3924 return longestIndex;
3925 }
3926 function serializeHost(host) {
3927 if (typeof host === "number") {
3928 return serializeIPv4(host);

Callers 1

serializeIPv6Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…