javascript_helper

package
v2.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyCryptoMD5    = "md5"
	KeyCryptoSHA1   = "sha1"
	KeyCryptoSHA256 = "sha256"
	KeyCryptoSHA512 = "sha512"
)
View Source
const (
	KeyMcUtils = "mcUtils"
)

Variables

This section is empty.

Functions

func GetHelperUtils

func GetHelperUtils() map[string]interface{}

includes helper functions

Types

type Convert

type Convert struct {
}

func (*Convert) HexStringToBytes

func (ll *Convert) HexStringToBytes(data string) []byte

returns bytes from hex string

func (*Convert) HexStringToString

func (ll *Convert) HexStringToString(data string) string

returns string from hex string

func (*Convert) ToBytes

func (ll *Convert) ToBytes(data string) []byte

returns string to byte

func (*Convert) ToHexString

func (ll *Convert) ToHexString(data interface{}) string

returns anything to hex string

func (*Convert) ToInt16BE added in v2.1.1

func (ll *Convert) ToInt16BE(bytes []byte) int16

ToInt16BE converts a 2-byte big-endian slice to an int16, preserving the sign using two's complement representation.

func (*Convert) ToInt16LE

func (ll *Convert) ToInt16LE(bytes []byte) int16

ToInt16LE converts a 2-byte little-endian slice to an int16, preserving the sign using two's complement representation.

func (*Convert) ToInt32BE added in v2.1.1

func (ll *Convert) ToInt32BE(bytes []byte) int32

ToInt32BE converts a 4-byte big-endian slice to an int32, preserving the sign using two's complement representation.

func (*Convert) ToInt32LE added in v2.1.1

func (ll *Convert) ToInt32LE(bytes []byte) int32

ToInt32LE converts a 4-byte little-endian slice to an int32, preserving the sign using two's complement representation.

func (*Convert) ToInt64BE added in v2.1.1

func (ll *Convert) ToInt64BE(bytes []byte) int64

ToInt64BE converts an 8-byte big-endian slice to an int64, preserving the sign using two's complement representation.

func (*Convert) ToInt64LE added in v2.1.1

func (ll *Convert) ToInt64LE(bytes []byte) int64

ToInt64LE converts an 8-byte little-endian slice to an int64, preserving the sign using two's complement representation.

func (*Convert) ToString

func (ll *Convert) ToString(data interface{}) string

returns anything to string

func (*Convert) ToStringFromBase64

func (ll *Convert) ToStringFromBase64(data interface{}) string

returns string from base64

func (*Convert) ToUInt16BE

func (ll *Convert) ToUInt16BE(bytes []byte) uint16

ToUInt16BE converts a 2-byte big-endian slice to a uint16.

func (*Convert) ToUInt16LE

func (ll *Convert) ToUInt16LE(bytes []byte) uint16

ToUInt16LE converts a 2-byte little-endian slice to a uint16.

func (*Convert) ToUInt32BE added in v2.1.1

func (ll *Convert) ToUInt32BE(bytes []byte) uint32

ToUInt32BE converts a 4-byte big-endian slice to a uint32.

func (*Convert) ToUInt32LE added in v2.1.1

func (ll *Convert) ToUInt32LE(bytes []byte) uint32

ToUInt32LE converts a 4-byte little-endian slice to a uint32.

func (*Convert) ToUInt64BE added in v2.1.1

func (ll *Convert) ToUInt64BE(bytes []byte) uint64

ToUInt64BE converts an 8-byte big-endian slice to a uint64.

func (*Convert) ToUInt64LE added in v2.1.1

func (ll *Convert) ToUInt64LE(bytes []byte) uint64

ToUInt64LE converts an 8-byte little-endian slice to a uint64.

type Crypto

type Crypto struct {
}

func (*Crypto) MD5Bytes

func (c *Crypto) MD5Bytes(data string) [16]byte

func (*Crypto) MD5HexString

func (c *Crypto) MD5HexString(data string) string

func (*Crypto) Sha1Bytes

func (c *Crypto) Sha1Bytes(data string) [20]byte

func (*Crypto) Sha1HexString

func (c *Crypto) Sha1HexString(data string) string

func (*Crypto) Sha256Bytes

func (c *Crypto) Sha256Bytes(data string) [32]byte

func (*Crypto) Sha256HexString

func (c *Crypto) Sha256HexString(data string) string

func (*Crypto) Sha512Bytes

func (c *Crypto) Sha512Bytes(data string) [64]byte

func (*Crypto) Sha512HexString

func (c *Crypto) Sha512HexString(data string) string

type HttpClient

type HttpClient struct {
}

func (*HttpClient) New

func (hc *HttpClient) New(insecure bool, timeout string) *httpclient.Client

Jump to

Keyboard shortcuts

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