constants

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultAlgorithm 默认加密算法
	DefaultAlgorithm = AlgorithmPBEWithHMACSHA256AndAES256

	// DefaultPasswordIterations 默认密码迭代次数
	DefaultPasswordIterations = 1000

	// DefaultSaltSize 默认Salt大小
	DefaultSaltSize = 16

	// DefaultIVSize 0表示使用算法默认
	DefaultIVSize = 0

	// DefaultOutputType 默认输出类型
	DefaultOutputType = OutputTypeBase64

	// DefaultIVGenerator 默认IV生成器
	DefaultIVGenerator = IVGeneratorRandom

	// DefaultSaltGenerator 默认Salt生成器
	DefaultSaltGenerator = SaltGeneratorRandom

	// DefaultPrefix 默认前缀
	DefaultPrefix = "ENC("

	// DefaultSuffix 默认后缀
	DefaultSuffix = ")"
)

Default constants

Variables

This section is empty.

Functions

This section is empty.

Types

type Algorithm

type Algorithm string

Algorithm 加密算法常量

const (
	// AlgorithmPBEWithMD5AndDES PBE with MD5 and DES算法
	AlgorithmPBEWithMD5AndDES Algorithm = "PBEWithMD5AndDES"

	// AlgorithmPBEWithSHA1AndDESede PBE with SHA1 and 3DES算法
	AlgorithmPBEWithSHA1AndDESede Algorithm = "PBEWithSHA1AndDESede"

	// AlgorithmPBEWithHMACSHA256AndAES256 PBE with HMAC SHA256 and AES-256算法
	AlgorithmPBEWithHMACSHA256AndAES256 Algorithm = "PBEWithHMACSHA256AndAES_256"
)

func (Algorithm) String

func (a Algorithm) String() string

String 返回算法字符串表示

type IVGeneratorType

type IVGeneratorType string

IVGeneratorType IV生成器类型常量

const (
	// IVGeneratorRandom 随机IV生成器
	IVGeneratorRandom IVGeneratorType = "random"
)

func (IVGeneratorType) String

func (igt IVGeneratorType) String() string

String 返回IV生成器类型字符串表示

type OutputType

type OutputType string

OutputType 输出类型常量

const (
	// OutputTypeBase64 Base64输出格式
	OutputTypeBase64 OutputType = "base64"

	// OutputTypeHex Hex输出格式
	OutputTypeHex OutputType = "hex"
)

func (OutputType) String

func (ot OutputType) String() string

String 返回输出类型字符串表示

type SaltGeneratorType

type SaltGeneratorType string

SaltGeneratorType Salt生成器类型常量

const (
	// SaltGeneratorRandom 随机Salt生成器
	SaltGeneratorRandom SaltGeneratorType = "random"
)

func (SaltGeneratorType) String

func (sgt SaltGeneratorType) String() string

String 返回Salt生成器类型字符串表示

Jump to

Keyboard shortcuts

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