utils

package
v0.0.0-...-68f1f64 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PATTERN = regexp.MustCompile(`((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?\.){3})(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)`)

Functions

func CorsMiddleware

func CorsMiddleware() mux.MiddlewareFunc

CorsMiddleware returns a new mux.MiddlewareFunc that applies CORS middleware.

func FindNeighbors

func FindNeighbors(myHost string, myPort uint16, startIp uint8, endIp uint8, startPort uint16, endPort uint16) []string

func GetHost

func GetHost() string

func IsFoundHost

func IsFoundHost(host string, port uint16) bool

func JsonStatus

func JsonStatus(message string) []byte

func PrivateKeyFromString

func PrivateKeyFromString(s string, publicKey *ecdsa.PublicKey) *ecdsa.PrivateKey

Create a private key from a string.

func PublicKeyFromString

func PublicKeyFromString(s string) *ecdsa.PublicKey

Create a public key from a string.

func String2BigIntTuple

func String2BigIntTuple(s string) (big.Int, big.Int)

String2BigIntTuple converts a hexadecimal string into a tuple of big integers. The input string is expected to have a length of 128 characters (64 characters for x and 64 characters for y). It returns the tuple (x, y) as pointers to big.Int values.

Types

type Signature

type Signature struct {
	R *big.Int
	S *big.Int
}

func SignatureFromString

func SignatureFromString(s string) *Signature

func (*Signature) String

func (s *Signature) String() string

Create a string representation of the signature.

Jump to

Keyboard shortcuts

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