Documentation
¶
Overview ¶
Package utils favicon相关工具
Package utils 工具集合
Index ¶
- func CompareVersions(version1, version2 string) int
- func Duration2String(t time.Duration) string
- func FaviconHash(data []byte) int32
- func GetFaviconBytes(hp *httpx.HTTPX, domain string, resp []byte) ([]byte, error)
- func GetMiddleText(left, right, html string) string
- func InsertInto(s string, interval int, sep rune) string
- func IsCIDR(cidr string) bool
- func IsDir(path string) bool
- func IsFileExists(path string) bool
- func ScanDir(path string) ([]string, error)
- func TrimProtocol(targetURL string) string
- type PortInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareVersions ¶
CompareVersions 比较两个版本号字符串 version1, version2: 待比较的版本号 返回值: 1 表示 version1 大于 version2
-1 表示 version1 小于 version2 0 表示两个版本号相等
func Duration2String ¶
Duration2String 将时间段转换为可读的字符串格式 如果时间超过60秒则返回分钟,否则返回秒
func FaviconHash ¶
FaviconHash 计算网站图标的哈希值 将数据进行base64编码后使用murmur3哈希算法计算
func GetFaviconBytes ¶
GetFaviconBytes retrieves the favicon bytes from a website 这个函数用于获取网站的favicon图标数据
func GetMiddleText ¶
GetMiddleText 获取两个字符串之间的文本内容 left: 左边界字符串 right: 右边界字符串 html: 源文本 返回左右边界之间的文本,如果未找到则返回空字符串
func InsertInto ¶
InsertInto 在字符串中每隔指定间隔插入分隔符 s: 源字符串 interval: 插入间隔 sep: 分隔符
func IsFileExists ¶
IsFileExists 检查文件是否存在 path: 文件路径 返回布尔值表示文件是否存在
func TrimProtocol ¶
TrimProtocol 移除URL中的HTTP/HTTPS协议前缀 targetURL: 目标URL 返回去除协议前缀后的URL
Types ¶
Click to show internal directories.
Click to hide internal directories.