feature

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var All = []rune{
	'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
	'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
	'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
	'/', '{', '}', '_', '-', '.', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '=', '+', '[', ']', '\\', '|', ';', ':', '\'', '"', '<', '>', ',', '?', '`', '~',
}
View Source
var Char = []rune{
	'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
	'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
}
View Source
var CharUpper = []rune{
	'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
}
View Source
var Charlower = []rune{
	'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
}
View Source
var Num = []rune{
	'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
}
View Source
var Special = []rune{
	'/', '{', '}', '_', '-', '.', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '=', '+', '[', ']', '\\', '|', ';', ':', '\'', '"', '<', '>', ',', '?', '`', '~',
}

Functions

func AppendFile added in v0.0.4

func AppendFile(filename string, data []byte)

AppendFile append data to file

func DelItemArr added in v0.0.4

func DelItemArr(arr []string, f func(string) bool) []string

DelItemArr delete item in array

func EscapeChar added in v0.0.4

func EscapeChar(data string, char ...string) string

EscapeChar escape char

func Itertools

func Itertools(prefix_length int, char []rune) []string

Using prefix_length := 3

feature.Itertools(prefix_length, feature.Char)

Itertools return all possible combination of characters

func Pencode added in v0.0.4

func Pencode(listEncoder []string, data string) string

Using pencode to encode/decode data

Supported encoder: b64encode, hexencode, htmlescape, jsonescape, unicodeencode, urlencode, urlencodeall ,xmlencode, utf16, utf16be, xmlescape

Supported decoder: b64decode, hexdecode, htmlunescape, jsonunescape, unicodedecode, urldecode, xmlunescape

Supported hash: md5, sha1, sha224 ,sha256, sha384 ,sha512

Other: lower, upper

func ReadFile added in v0.0.3

func ReadFile(filename string) ([]string, error)

ReadFile read file and return string

func ReadJson added in v0.0.4

func ReadJson(data string) (map[string]interface{}, error)

For example it return like

map[string]interface {}{
    "message": []interface {}{
        map[string]interface {}{
            "content":   "3",
        },
    },
}

xx, _ = datatemp["message"].([]interface{})[0].(map[string]interface{})["content"].(string)

func SingleLine

func SingleLine(data string) string

SingleLine remove all \t and \n

func Str2Int added in v0.0.4

func Str2Int(data string) int

Str = "123" -> 123

func Str2Rune added in v0.0.4

func Str2Rune(data string) []rune

"123" -> []rune{1, 2, 3} -> string(rune) = "123"

func WriteFile added in v0.0.3

func WriteFile(filename string, data []byte) error

WriteFile write data to new file

func ZipFile

func ZipFile(destinationZip string, sourceFile ...File) error

Create a zip file

Types

type File

type File struct {
	Name string
	Body string
}

Directories

Path Synopsis
db

Jump to

Keyboard shortcuts

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