Documentation
¶
Overview ¶
* This package provides functions for encoding and decoding between strings and Binary-Coded Decimal (BCD) format.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decode ¶
* Decode takes a BCD encoded slice of bytes and decodes it to a numeric string, returning an error if the input * contains invalid BCD values. * * The function returns the numeric string or an empty string and an error.
func Encode ¶
* Encode takes a string `s` containing only numeric characters ('0' to '9') and encodes it to BCD, prepending a * leading zero if necessary. Returns an error if the input string contains any non-numeric characters. * * The function returns a pointer to a newly allocated slice containing the BCD encoded bytes or a `nil` result * and an error if the input string cannot be encoded.
Types ¶
This section is empty.