compress

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(packedDeltas []byte) ([]float64, error)

func Encode

func Encode(data []float64, precision uint64) ([]byte, error)
TODO: Refactor

- Use variants. - Use data compression outsides

func PackPrice

func PackPrice(buf io.ByteWriter, bid, askDiff uint64) error

func PriceZip

func PriceZip(bid, askDiff uint64) []byte

func WriteVariant

func WriteVariant(buf io.ByteWriter, x uint64) error

Types

type IPrice

type IPrice interface {
	Price(precision float64) [2]float64
	Write(buf *bytes.Buffer) error
	Bytes() []byte
}

func Price

func Price(bid, askDiff uint64) IPrice

Jump to

Keyboard shortcuts

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