-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use length of the field value for prefixer, not length of encoded data (
#227) * use length of the field value for prefixer, not length of encoded data * add test for composite with BCD fields * update composite test and hex field * add tests for Hex field * fix typo * update description of the Hex field
- Loading branch information
Showing
13 changed files
with
506 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
package encoding | ||
|
||
type Encoder interface { | ||
// Encode encodes source data (ASCII, characters, digits, etc.) into | ||
// destination bytes. It returns encoded bytes and any error | ||
Encode([]byte) ([]byte, error) | ||
// Returns data decoded into ASCII (or bytes), how many bytes were read, error | ||
|
||
// Decode decodes data into into bytes (ASCII, characters, digits, | ||
// etc.). It returns the bytes representing the decoded data, the | ||
// number of bytes read from the input, and any error | ||
Decode([]byte, int) (data []byte, read int, err error) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.