encrypt

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2024 License: AGPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const MAX_UINT32 = 0xffffffff

Variables

View Source
var POLY8 = struct {
	CRC8              byte
	CRC8_CCITT        byte
	CRC8_DALLAS_MAXIM byte
	CRC8_SAE_J1850    byte
	CRC_8_WCDMA       byte
}{
	CRC8:              0xd5,
	CRC8_CCITT:        0x07,
	CRC8_DALLAS_MAXIM: 0x31,
	CRC8_SAE_J1850:    0x1d,
	CRC_8_WCDMA:       0x9b,
}

CRC8 Polynomial values

View Source
var RawURLCache = cache.NewMemCache(cache.WithShards(128))

****************************************************

Functions

func DecryptFileName

func DecryptFileName(fileName string) string

func GetCheckBit

func GetCheckBit(text string) byte

CheckBit function

func GetSourceChar

func GetSourceChar(index byte) byte

GetSourceChar function

func RandomSecret

func RandomSecret() string

RandomSecret function

func RandomStr

func RandomStr(length int) string

RandomStr function

func Redirect

func Redirect(host string, reqPath string, realUrl string, fileSize int64) string

Types

type AesCTR

type AesCTR struct {
	// contains filtered or unexported fields
}

func NewAesCTR

func NewAesCTR(password string, sizeSalt int) (*AesCTR, error)

func (*AesCTR) Decrypt

func (ac *AesCTR) Decrypt(message []byte) []byte

func (*AesCTR) Encrypt

func (ac *AesCTR) Encrypt(message []byte) []byte

func (*AesCTR) SetPosition

func (ac *AesCTR) SetPosition(position int)

type CRCn

type CRCn struct {
	// contains filtered or unexported fields
}

func NewCRCn

func NewCRCn(num int, polynomial byte, initialValue byte) *CRCn

Constructor for CRCn

func (*CRCn) Checksum

func (crc *CRCn) Checksum(byteArray []byte) byte

Calculate the checksum

type MixBase64

type MixBase64 struct {
	// contains filtered or unexported fields
}

MixBase64 structure

func NewMixBase64

func NewMixBase64(passwd string, salt string) *MixBase64

func (*MixBase64) Decode

func (m *MixBase64) Decode(base64Str string) ([]byte, error)

Decode method

func (*MixBase64) Encode

func (m *MixBase64) Encode(data []byte) string

Encode method

Jump to

Keyboard shortcuts

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