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

Function serializeIPv6

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

Source from the content-addressed store, hash-verified

3833 return address;
3834 }
3835 function serializeIPv6(address) {
3836 let output = "";
3837 const compress = findTheIPv6AddressCompressedPieceIndex(address);
3838 let ignore0 = false;
3839 for (let pieceIndex = 0; pieceIndex <= 7; ++pieceIndex) {
3840 if (ignore0 && address[pieceIndex] === 0) {
3841 continue;
3842 } else if (ignore0) {
3843 ignore0 = false;
3844 }
3845 if (compress === pieceIndex) {
3846 const separator = pieceIndex === 0 ? "::" : ":";
3847 output += separator;
3848 ignore0 = true;
3849 continue;
3850 }
3851 output += address[pieceIndex].toString(16);
3852 if (pieceIndex !== 7) {
3853 output += ":";
3854 }
3855 }
3856 return output;
3857 }
3858 function parseHost(input, isOpaque = false) {
3859 if (input[0] === "[") {
3860 if (input[input.length - 1] !== "]") {

Callers 1

serializeHostFunction · 0.85

Calls 2

toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…