utils

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 14 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculatePublicKeyBytes

func CalculatePublicKeyBytes(pub *ecdsa.PublicKey) []byte

func DeriveThingsIxID added in v1.0.3

func DeriveThingsIxID(pub *ecdsa.PublicKey) [32]byte

func Eui64FromString

func Eui64FromString(str string) (lorawan.EUI64, error)

Eui64FromString tries to read a lorawan.EUI64 from string. It returns an error if it doesn't succeed.

func Eui64ToUint64

func Eui64ToUint64(eui64 lorawan.EUI64) uint64

Eui64ToUint64 converts a lorawan.EUI64 into an uint64 in BigEndian format.

func GeneratePrivateKey

func GeneratePrivateKey() (*ecdsa.PrivateKey, error)

func HexStringToBigIntHook

func HexStringToBigIntHook() mapstructure.DecodeHookFunc

HexStringToBigIntHook converts from a string to a big.Int when required

func Info added in v1.0.8

func Info() (string, string)

func IntToBigIntHook

func IntToBigIntHook() mapstructure.DecodeHookFunc

IntToBigIntHook converts a int to a *big.Int when required

func NetIDType added in v1.1.0

func NetIDType(a lorawan.DevAddr) int

NetIDType returns the NetID type of the DevAddr.

func NwkId added in v1.1.0

func NwkId(a lorawan.DevAddr) []byte

func NwkIdString added in v1.1.0

func NwkIdString(a lorawan.DevAddr) string

func Ptr

func Ptr[T any](v T) *T

func RandUint32

func RandUint32() uint32

func StringToDuration

func StringToDuration() mapstructure.DecodeHookFunc

StringToDuration converts from a string into a time.Duration when required

func StringToEthereumAddressHook

func StringToEthereumAddressHook() mapstructure.DecodeHookFunc

StringToEthAddressHook converts from a string to an ethereum address when required

func StringToHashHook

func StringToHashHook() mapstructure.DecodeHookFunc

StringToHashHook converts from a string to a ecommon.Hash when required

func StringToLogrusLevel

func StringToLogrusLevel() mapstructure.DecodeHookFunc

StringToLogrusLevel converts from a string into a logrus.Level when required

func Version

func Version() string

Types

This section is empty.

Jump to

Keyboard shortcuts

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