sysUtils

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ASC  = "asc"
	DESC = "desc"
)

Variables

This section is empty.

Functions

func AppendWriteFile

func AppendWriteFile(data any, filename string)

AppendWriteFile Append writes to file

func BcryptCheck

func BcryptCheck(pwd, hashPwd string) bool

BcryptCheck Password proofreading

func BcryptEncryption

func BcryptEncryption(pwd string) string

BcryptEncryption Password encryption

func CheckFileExists

func CheckFileExists(path string) bool

CheckFileExists Checks whether a file or directory exists

func DecryptFile

func DecryptFile(password string, filename string) ([]byte, error)

func EncryptFile

func EncryptFile(password string, inputFile string, outputFile string) error

func ExistsInArray

func ExistsInArray(value, array any) bool

ExistsInArray Whether a value exists in an array

func FileToMD5Encrypt

func FileToMD5Encrypt(path string) (string, error)

FileToMD5Encrypt Compute file MD5

func FileToSHA1Encrypt

func FileToSHA1Encrypt(path string) (string, error)

FileToSHA1Encrypt Calculate file SHA1

func GetClientIP

func GetClientIP(req *http.Request) string

GetClientIP Get request IP address

func GetDirAllFileNames

func GetDirAllFileNames(dir string, suffix ...string) []string

GetDirAllFileNames Gets all file names with the specified suffix in the directory

func GetLocalIP

func GetLocalIP() string

GetLocalIP Get local IP address

func GetUrlFileName

func GetUrlFileName(urlOrPath string) string

GetUrlFileName Gets the value of the argument 'filename' from the URl

func HideTheString

func HideTheString(s string, head int, end int, content string) string

HideTheString Hide the middle part of the field string and replace it with a pointer [*]

func JsonEncode

func JsonEncode(data any) string

JsonEncode Convert any type of data to JSON-formatted strings

func PrintDirectoryStructure

func PrintDirectoryStructure(path, prefix string)

func PrintToFile

func PrintToFile(data ...interface{})

PrintToFile debug output to file

func PrintVar

func PrintVar(data ...interface{})

PrintVar Print out any data type in a readable format

func SortInt

func SortInt(data []int, s ...string)

SortInt Sort slices of type int type[desc|asc]

func SortIntFloat64

func SortIntFloat64(data []float64, s ...string)

SortIntFloat64 Sort slices of type Float type[desc|asc]

func SortMapByKey

func SortMapByKey(inputMap map[string]any) []string

SortMapByKey Returns the order of the map's kye

func SortMapByValue

func SortMapByValue(inputMap map[string]any) []keyValue

SortMapByValue Sort by map values

func SortString

func SortString(data []string, s ...string)

SortString Sort slices of string type. type[desc|asc]

func SortStruct

func SortStruct(data any, field string, s ...string) error

SortStruct Sort the structure slices by any field Field type[desc|asc]

func StringToMD5Check

func StringToMD5Check(str []byte, md5Code string) bool

StringToMD5Check Collate string MD5

func StringToMD5Encrypt

func StringToMD5Encrypt(str []byte) string

StringToMD5Encrypt Compute string MD5

func StringToSHA1Encrypt

func StringToSHA1Encrypt(str []byte) string

StringToSHA1Encrypt Evaluates the string SHA1

func StringToSHA256Encrypt

func StringToSHA256Encrypt(str []byte) string

StringToSHA256Encrypt Evaluates the string SHA256

func StringToSHA512Encrypt

func StringToSHA512Encrypt(str []byte) string

StringToSHA512Encrypt Evaluates the string SHA512

Types

This section is empty.

Jump to

Keyboard shortcuts

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