toft

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2022 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodingBinaryToImage

func DecodingBinaryToImage(b []byte) (img image.Image, err error)

DecodingBinaryToImage 解码二进制图片

func EncodingImageToBase64StrForJpeg

func EncodingImageToBase64StrForJpeg(img image.Image, quality int) string

EncodingImageToBase64StrForJpeg 将普通(JPG,JPEG)图片转为base64字符串

func EncodingImageToBase64StrForPng

func EncodingImageToBase64StrForPng(img image.Image) string

EncodingImageToBase64StrForPng 将png格式图片转为base64字符串

func EncodingImageToBinaryWithJpeg

func EncodingImageToBinaryWithJpeg(img image.Image, quality int) (ret []byte)

EncodingImageToBinaryWithJpeg 图片编码为二进制(image格式)

func EncodingImageToBinaryWithPng

func EncodingImageToBinaryWithPng(img image.Image) (ret []byte)

EncodingImageToBinaryWithPng 图片编码为二进制(png格式)

func GenCaptchaKey

func GenCaptchaKey(str string) (string, error)

GenCaptchaKey 生成唯一KEY

func GenUniqueId

func GenUniqueId() string

GenUniqueId 创建唯一ID

func GetRandomColorValueByRGBA

func GetRandomColorValueByRGBA(cs []color.Color) color.RGBA

GetRandomColorValueByRGBA 从Color列表中随机获取一个颜色的RGBA值

func GetRandomStringValue

func GetRandomStringValue(s []string) string

GetRandomStringValue 从字符串列表中随机获取一个值

func GetRootDirectory

func GetRootDirectory() string

GetRootDirectory 获取项目根目录

func Md5ToStr

func Md5ToStr(str string) string

Md5ToStr MD5加密字符串

func ParseHexColorToRGBA

func ParseHexColorToRGBA(s string) (c color.RGBA, err error)

ParseHexColorToRGBA 十六进制颜色转为color.RGBA

func PathExists

func PathExists(path string) (bool, error)

PathExists 检查路径是否存在

func RandInt

func RandInt(min, max int) int

RandInt 生成区间[-m, n]的安全随机数

func RandomCreateSimplifyZHCNUnicode

func RandomCreateSimplifyZHCNUnicode() (string, string)

RandomCreateSimplifyZHCNUnicode 随机生成简化汉字中文Unicode编码及转义字符

func RandomCreateZHCNUnicode

func RandomCreateZHCNUnicode() (string, string)

RandomCreateZHCNUnicode 随机生成中文Unicode编码及转义字符

Types

This section is empty.

Jump to

Keyboard shortcuts

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