Kind: Function
Source: src/utils/ipaddr.ts
Part of: Utils
Convert a binary representation of an IPv6 address to a string.
convertIPv6BinaryToString converts an IPv6 address from its binary representation into a string. Use it at boundaries where binary address data must be displayed, logged, or passed to code that expects an IPv6 string.
Signature
tsfunction convertIPv6BinaryToString(ipV6: bigint): string
Parameters
| Name | Type |
|---|---|
ipV6 | bigint |
Returns: string
Diagram
mermaidgraph LR A[Binary IPv6 value] --> B[convertIPv6BinaryToString] B --> C[IPv6 string]
Usage
tsimport { convertIPv6BinaryToString } from "./utils/ipaddr";
// Obtain the binary IPv6 value from a network, parser, or storage layer.
declare const binaryIPv6: string;
const ipv6Address = convertIPv6BinaryToString(binaryIPv6);
console.log(ipv6Address);
AI Coding Instructions
- Pass the binary IPv6 value to this function, not an already formatted IPv6 string.
- Keep binary-to-string conversion at input or output boundaries rather than spreading address formatting logic across callers.
- Preserve the binary value unchanged before conversion; changing its order changes the resulting address.
- Use the returned string for display, logging, serialization, or APIs that accept textual IPv6 addresses.
Used by
1 reference from 1 file. Each is a place in this repository where the symbol is actually used — go read one rather than trusting an example.
Imported by (1)
IPRestrictionRule—src/middleware/ip-restriction/index.ts:38
Was this page helpful?