utils

package
v0.0.0-...-957e36a Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64Decode

func Base64Decode(data string) ([]byte, error)

func Base64Encode

func Base64Encode(data []byte) string

func Decrypt

func Decrypt(sharedKey []byte, b64cipherData string) ([]byte, error)

func DecryptByPass

func DecryptByPass(pass string, b64cipherData string) ([]byte, error)

func ECDH

func ECDH(priKey, pubKey []byte) ([]byte, error)

func Encrypt

func Encrypt(sharedKey, data []byte) (string, error)

func EncryptByPass

func EncryptByPass(pass string, data []byte) string

func EncryptUserAddress

func EncryptUserAddress(ctx *swe.Context, pubKey []byte, addr *RewardUserAddress) (string, error)

func GenerateECDHKeyPair

func GenerateECDHKeyPair() (priKey, pubKey []byte, err error)

func GenerateID

func GenerateID() int64

func IsValidTimeString

func IsValidTimeString(ts string) bool

func LogRenderer

func LogRenderer() swe.LogRenderer

func TimeStringToUTC

func TimeStringToUTC(ts string) (int64, error)

func TimeToCSTString

func TimeToCSTString(timestamp int64) string

Types

type PriorQueue

type PriorQueue[T any] struct {
	// contains filtered or unexported fields
}

func PriorityQueue

func PriorityQueue[T any](cmp func(*T, *T) bool) *PriorQueue[T]

func (*PriorQueue[T]) Head

func (q *PriorQueue[T]) Head() *T

func (*PriorQueue[T]) Pop

func (q *PriorQueue[T]) Pop() *T

func (*PriorQueue[T]) Put

func (q *PriorQueue[T]) Put(value *T)

type RewardUserAddress

type RewardUserAddress struct {
	Name  string `json:"name"`
	Phone string `json:"phone"`
	Addr  string `json:"addr"`
}

func DecryptUserAddress

func DecryptUserAddress(ctx *swe.Context, pubKey []byte, addr string) (*RewardUserAddress, error)

Jump to

Keyboard shortcuts

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