Function guessAddressType
Returns the type of address that is represented in address
When one is presented with a string, e.g. from user input, the correect type might need to be guessed. In Agora's case, there are only three kind of addresses that may be guessed: domain names (CNAME), IPv4 addresses (A), or IPv6 addresses (AAAA).
This function implements a few heuristics to guess which one it is. By default, we consider that an address is a CNAME.
Parameters
Name | Description |
---|---|
address | The string to guess the type of |
Returns
By default, TYPE
, and depending on the format,
either TYPE
or TYPE