Open Abhinavcode13 opened 3 months ago
I withdraw (and deleted) my previous comment. If you happen to see it in email, you can ignore it.
Is there a example use case you expect where this new decode
function would be used?
I withdraw (and deleted) my previous comment. If you happen to see it in email, you can ignore it.
Is there a example use case you expect where this new
decode
function would be used?
@jafingerhut
The main reason for including this decode
function is as follows:
So the thing that seems strange to me about this new function is that you give it a byte string, with presumably no knowledge whatsoever of what that byte string is intended to represent. This new decode function assumes it is either an IPv6 address, an IPv4 address, or a MAC address, and opportunistically tries to decode it to a human-readable string representing that address, even if the byte string is just some other 128-, 32-, or 48-bit value that has nothing to do with one of those address types. It seems difficult for me to imagine when one would find that useful. At least with the existing decodeIPv4, decodeIPv6, and decodeMac, the caller knows that the byte string is supposed to represent an address of the given kind, and tries to decode it with that assumption.
Thank you for pointing that out! I'll revisit my implementation for this decode
function to ensure it aligns with the intended use case.
decode
function can decode various types of encoded values.