semioctet

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: MIT Imports: 2 Imported by: 2

Documentation

Overview

Package semioctet provides conversions to and from semioctet format.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrMissingFill indicates the final src octet does not contain the
	// expected fill character 'F'.
	ErrMissingFill = errors.New("semioctet: last src octet missing expected fill")
)

Functions

func Decode

func Decode(dst, src []byte) ([]byte, int, error)

Decode converts a semi-octet encoded field into the corresponding array of UTF-8 digits, as per 3GPP TS 23.040 Section 9.1.2.3

Conversion is terminated by the length of the src or dst. The length of the dst indicates the maximum number of digits to return. The return values are the decoded field (a slice of dst), the number of bytes read from src, and any error detected during the conversion.

func Encode

func Encode(src []byte) ([]byte, error)

Encode converts an array of UTF-8 digits into semi-octet format, as per 3GPP TS 23.040 Section 9.1.2.3

The return values are the encoded field, and any error detected during the conversion.

Types

type ErrInvalidDigit

type ErrInvalidDigit byte

ErrInvalidDigit indicates that the digit can not be encoded into semioctet format.

func (ErrInvalidDigit) Error

func (e ErrInvalidDigit) Error() string

Jump to

Keyboard shortcuts

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