mbin

package
v0.0.0-...-91c5940 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2017 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const HEXA_DIGITS = "0123456789abcdef" // used to convert a byte into hexa digit

Variables

This section is empty.

Functions

func Append_hexastring

func Append_hexastring(dest []byte, source Mybin) []byte

Append_hexastring appends source in hexa notation, into dest string.

func Bin2uint64

func Bin2uint64(source Mybin) (uint64, *rsql.Error)

func Hexa2bin

func Hexa2bin(dest *Mybin, source []byte) *rsql.Error

Hexa2bin copies source string made of hexa digits into dest, converting hexa digits into binary bytes. Empty binary string "0x" is allowed, and the result is an empty byte slice.

The hexa string must begin with "0x", else, an error is returned. "0x" is followed by hexa digits, from most significant bytes (MSB) to least significant bytes (LSB) if considered as number, or first byte to last byte if stream of bytes.

An error is returned if a non-hexa digit is found.

Types

type Mybin

type Mybin []byte // byte at index 0 is MSB when considered as a number, and byte 0 when considered as stream of bytes. Note: cast(0x0401 as varbinary(1)) = 0x04, and cast(0x0401 as int) = 1025

Jump to

Keyboard shortcuts

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