common

package
v0.0.22 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyPtr

func AnyPtr(v interface{}) interface{}

AnyPtr 将任意类型的值转换为指针 如果值已经是指针,则直接返回 如果值是 nil,则返回 nil 否则创建一个新的指针指向该值

func Base64Decode added in v0.0.10

func Base64Decode(s string) (string, error)

Base64Decode 将 Base64 编码的字符串解码

func Base64Encode added in v0.0.10

func Base64Encode(s string) string

Base64Encode 将字符串进行 Base64 编码

func HtmlDecode added in v0.0.10

func HtmlDecode(s string) string

HtmlDecode 对 HTML 实体编码的字符串进行解码

func HtmlEncode added in v0.0.10

func HtmlEncode(s string) string

HtmlEncode 对字符串进行 HTML 实体编码

func JsonDecode added in v0.0.10

func JsonDecode(s string, v interface{}) error

JsonDecode 将 JSON 字符串解析为对象

func JsonEncode added in v0.0.10

func JsonEncode(v interface{}) (string, error)

JsonEncode 将对象转换为 JSON 字符串

func Md5 added in v0.0.10

func Md5(s string) string

Md5 计算字符串的 MD5 哈希值

func Sha1 added in v0.0.10

func Sha1(s string) string

Sha1 计算字符串的 SHA1 哈希值

func Sha256 added in v0.0.10

func Sha256(s string) string

Sha256 计算字符串的 SHA256 哈希值

func Timestamp added in v0.0.10

func Timestamp() int64

Timestamp 获取当前时间戳(秒)

func UrlDecode added in v0.0.10

func UrlDecode(s string) (string, error)

UrlDecode 对 URL 编码的字符串进行解码

func UrlEncode added in v0.0.10

func UrlEncode(s string) string

UrlEncode 对字符串进行 URL 编码

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL