encrypt

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(encryptStr string) int

Decrypt @Description: hashId解密 @receiver h @param encryptStr @return int

func Encrypt

func Encrypt(num int) string

Encrypt @Description:hashId加密 @receiver h @param num @return string

Types

type Digital

type Digital struct {
	Length int
	Salt   string
}

func NewDigitalSecret

func NewDigitalSecret(length int, salt string) *Digital

NewDigitalSecret @Description: 实例化digital配置 @param length @param salt @return *Digital

func (*Digital) Decrypt

func (d *Digital) Decrypt(encryptStr string) int

Decrypt @Description: 字符串解密为数字 @receiver d @param encryptStr @return int

func (*Digital) Encrypt

func (d *Digital) Encrypt(num int) string

Encrypt @Description: 数字加密 @receiver d @param num 数字加密为字符串 @return string

type DigitalInterface

type DigitalInterface interface {
	Encrypt(num int) string
	Decrypt(str string) int
}

Jump to

Keyboard shortcuts

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