parsevalue

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MOD_NAME               = "STATIC_VALUE_"                  // 变量名
	MOD_STRING_HEAD        = "STRING_HEAD_"                   // 编码字符头
	MOD_STRING_HEAD_RANDOM = "VSXqtaRZLdqDyK94zuuWpSaFVREugy" // 字符串头随机部分 防止值重复

	RANDOM_NAME_HEAD   = "random_NAME_HEAD_"        // 随机变量名称的头信息
	MAX_VALUE_NAME_LEN = len(RANDOM_NAME_HEAD) + 36 // 变量名称[]byte最大长度

	MAX_STRING_LEN = 1 << 15 // 输入字符编码后[]byte最大长度
)

Variables

View Source
var (
	NAME_LEN = len(MOD_NAME) + len(MOD_STRING_HEAD) + len(MOD_STRING_HEAD_RANDOM)   // 特征头部字符串[]byte长度
	INFO_LEN = MAX_VALUE_NAME_LEN + len([]byte(strconv.Itoa(MAX_STRING_LEN)))*2 + 1 // 属性信息字符串[]byte长度
	DATA_LEN = MAX_STRING_LEN * 2                                                   // 内容字符串[]byte长度
	ALL_LEN  = NAME_LEN + INFO_LEN + DATA_LEN                                       // 总字符串[]byte长度
)

Functions

func ChangeValue

func ChangeValue(data *modules.ParseString, newValue string) (*modules.ParseString, error)

修改变量值

func Decode

func Decode(v string) (*modules.ParseString, error)

解码字符串的信息 格式化字符串数据结构

func Encode

func Encode(name, v string) (string, error)

将变量对象编码成字符串

func Get

func Get(data *modules.ParseString) string

获取变量的值

Types

This section is empty.

Jump to

Keyboard shortcuts

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