crypt

package
v0.0.19 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2021 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(str string) string

func Encode

func Encode(str string) string

Types

type CRCGenerator added in v0.0.14

type CRCGenerator struct {
	*rand.Rand
	// contains filtered or unexported fields
}

CRCGenerator -- (PSEUDO-RANDOM REPLICABLE SEEDED GENERATION)

func NewCRCGenerator added in v0.0.14

func NewCRCGenerator(generatorPoly uint64) *CRCGenerator

func (*CRCGenerator) GenChecksum added in v0.0.14

func (g *CRCGenerator) GenChecksum(seed string) string

func (*CRCGenerator) GenerateHash added in v0.0.16

func (g *CRCGenerator) GenerateHash(seed string) uint64

func (*CRCGenerator) Init added in v0.0.14

func (g *CRCGenerator) Init(seed string)

type Crypt

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

func New

func New(key []byte, generatorPoly uint64) *Crypt

New -- CRYPTO KEY 32 LEN BYTE KEY generatorPoly - UINT64 POLY FOR CRC TABLE (PSEUDO-RANDOM REPLICABLE SEEDED GENERATION) [DEPRECATED] - InitGenerator NEEDS TO BE CALLED WITH YOUR PROVIDED SEED TO SEED THE RANDOM GENERATOR FOR REPLICABLE GENERATION

func (*Crypt) Checksum added in v0.0.14

func (c *Crypt) Checksum(seed string) string

func (*Crypt) Decrypt

func (c *Crypt) Decrypt(data []byte) ([]byte, error)

func (*Crypt) Encrypt

func (c *Crypt) Encrypt(data []byte) ([]byte, error)

func (*Crypt) GetCRCGenerator added in v0.0.15

func (c *Crypt) GetCRCGenerator() *CRCGenerator

func (*Crypt) InitGenerator added in v0.0.14

func (c *Crypt) InitGenerator(seed string)

func (*Crypt) NewHashAndSalt

func (c *Crypt) NewHashAndSalt(str string) (hash, salt string)

func (*Crypt) VerifyPassword

func (c *Crypt) VerifyPassword(pwd, salt, hash string) bool

Jump to

Keyboard shortcuts

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