Documentation ¶
Index ¶
- Constants
- func AppendWriteFile(data any, filename string)
- func BcryptCheck(pwd, hashPwd string) bool
- func BcryptEncryption(pwd string) string
- func CheckFileExists(path string) bool
- func DecryptFile(password string, filename string) ([]byte, error)
- func EncryptFile(password string, inputFile string, outputFile string) error
- func ExistsInArray(value, array any) bool
- func FileToMD5Encrypt(path string) (string, error)
- func FileToSHA1Encrypt(path string) (string, error)
- func GetClientIP(req *http.Request) string
- func GetDirAllFileNames(dir string, suffix ...string) []string
- func GetLocalIP() string
- func GetUrlFileName(urlOrPath string) string
- func HideTheString(s string, head int, end int, content string) string
- func JsonEncode(data any) string
- func PrintDirectoryStructure(path, prefix string)
- func PrintToFile(data ...interface{})
- func PrintVar(data ...interface{})
- func SortInt(data []int, s ...string)
- func SortIntFloat64(data []float64, s ...string)
- func SortMapByKey(inputMap map[string]any) []string
- func SortMapByValue(inputMap map[string]any) []keyValue
- func SortString(data []string, s ...string)
- func SortStruct(data any, field string, s ...string) error
- func StringToMD5Check(str []byte, md5Code string) bool
- func StringToMD5Encrypt(str []byte) string
- func StringToSHA1Encrypt(str []byte) string
- func StringToSHA256Encrypt(str []byte) string
- func StringToSHA512Encrypt(str []byte) string
Constants ¶
const ( ASC = "asc" DESC = "desc" )
Variables ¶
This section is empty.
Functions ¶
func AppendWriteFile ¶
AppendWriteFile Append writes to file
func BcryptEncryption ¶
BcryptEncryption Password encryption
func CheckFileExists ¶
CheckFileExists Checks whether a file or directory exists
func ExistsInArray ¶
ExistsInArray Whether a value exists in an array
func FileToMD5Encrypt ¶
FileToMD5Encrypt Compute file MD5
func FileToSHA1Encrypt ¶
FileToSHA1Encrypt Calculate file SHA1
func GetDirAllFileNames ¶
GetDirAllFileNames Gets all file names with the specified suffix in the directory
func GetUrlFileName ¶
GetUrlFileName Gets the value of the argument 'filename' from the URl
func HideTheString ¶
HideTheString Hide the middle part of the field string and replace it with a pointer [*]
func JsonEncode ¶
JsonEncode Convert any type of data to JSON-formatted strings
func PrintDirectoryStructure ¶
func PrintDirectoryStructure(path, prefix string)
func PrintVar ¶
func PrintVar(data ...interface{})
PrintVar Print out any data type in a readable format
func SortIntFloat64 ¶
SortIntFloat64 Sort slices of type Float type[desc|asc]
func SortMapByKey ¶
SortMapByKey Returns the order of the map's kye
func SortMapByValue ¶
SortMapByValue Sort by map values
func SortString ¶
SortString Sort slices of string type. type[desc|asc]
func SortStruct ¶
SortStruct Sort the structure slices by any field Field type[desc|asc]
func StringToMD5Check ¶
StringToMD5Check Collate string MD5
func StringToMD5Encrypt ¶
StringToMD5Encrypt Compute string MD5
func StringToSHA1Encrypt ¶
StringToSHA1Encrypt Evaluates the string SHA1
func StringToSHA256Encrypt ¶
StringToSHA256Encrypt Evaluates the string SHA256
func StringToSHA512Encrypt ¶
StringToSHA512Encrypt Evaluates the string SHA512
Types ¶
This section is empty.