utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2020 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContentValidityCheck

func ContentValidityCheck(data []byte) bool

ContentValidityCheck : Check if has conflicted or empty invalid config in file

func DecryptData

func DecryptData(src []byte, passwd []byte) ([]byte, error)

DecryptData : Reverse action as for EncryptData

func EncryptData

func EncryptData(src []byte, passwd []byte) ([]byte, string, error)

EncryptData : ciphertext output as []byte, original text hash output as string

func GenBlake2B

func GenBlake2B(data []byte) string

GenBlake2B : Pack Blake2B-256 SUM to hex string

func GetNanoID

func GetNanoID() (string, error)

GetNanoID : Nano ID Getter

func GetUTCTimeHash

func GetUTCTimeHash(masterkey string) string

GetUTCTimeHash : MD5 Hash for verification of administration and masterkey

func IP2Intstr

func IP2Intstr(ipaddr string) (string, error)

IP2Intstr : this two functions is used to parse X-Real-IP for recording the X-Real-IP can only be done on LB side

func IsIPv6

func IsIPv6(ipdr net.IP) bool

IsIPv6 : Detect IPv6 or IPv4

func Pack2BinData

func Pack2BinData(data []byte) primitive.Binary

Pack2BinData : Used for transfer []byte to binary type in mongodb

Types

This section is empty.

Jump to

Keyboard shortcuts

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