helpers

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2019 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddBase64Padding

func AddBase64Padding(base64Input string) string

AddBase64Padding : Returns base 64 string adding extra padding if needed.

func ApplyScaleFactor

func ApplyScaleFactor(price float64, scaleFactor float64, isDebugMode bool) [8]byte

ApplyScaleFactor : Applies a scale factor to a given price. Scaled price will be represented on 8 bytes.

func CreateHmac

func CreateHmac(key string, isBase64 bool, mode KeyDecodingMode) (hash.Hash, error)

CreateHmac : Returns Hash from input string.

func HmacSum

func HmacSum(hmac hash.Hash, buf []byte) []byte

HmacSum : Returns Hmac sum bytes.

Types

type KeyDecodingMode

type KeyDecodingMode string

KeyDecodingMode : Describing how keys should be decoded.

const (
	// Utf8 : Key should be decoded as utf-8 string.
	Utf8 KeyDecodingMode = "utf-8"
	// Hexa : Key should be decoded as hexa string.
	Hexa KeyDecodingMode = "hexa"
)

func ParseKeyDecodingMode

func ParseKeyDecodingMode(input string) (KeyDecodingMode, error)

ParseKeyDecodingMode : Parses KeyDecodingMode from string.

func (KeyDecodingMode) String

func (kd KeyDecodingMode) String() string

String : Returns the KeyDecodingMode string representation.

Jump to

Keyboard shortcuts

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