Documentation ¶
Overview ¶
Package filterutil contains helper functions used by urlfilter
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractHostname ¶
ExtractHostname -- quickly retrieves hostname from an URL
func FastHash ¶ added in v0.15.0
FastHash implements the djb2 hash algorithm.
TODO(e.burkov): Inspect all uses. Perhaps use maphash.
func FastHashBetween ¶ added in v0.15.0
FastHashBetween implements the djb2 hash algorithm.
func IsDomainName ¶ added in v0.12.0
IsDomainName - check if input string is a valid domain name Syntax: [label.]... label.label
Each label is 1 to 63 characters long, and may contain:
. ASCII letters a-z and A-Z . digits 0-9 . hyphen ('-')
. labels cannot start or end with hyphens (RFC 952) . max length of ascii hostname including dots is 253 characters . TLD is >=2 characters . TLD is [a-zA-Z]+ or "xn--[a-zA-Z0-9]+"
func IsProbablyIP ¶ added in v0.17.0
IsProbablyIP returns true if s only contains characters that can be part of an IP address. It's needed to avoid unnecessary allocations when parsing with [netip.ParseAddr].
Types ¶
This section is empty.