ax(ueps): rename tagByte to tagType in writeTLV for semantic clarity
tagByte described the storage representation; tagType names the semantic role (the T in TLV = Type-Length-Value), matching AX Principle 1. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
ba9da9444c
commit
a8b2dad8ec
1 changed files with 2 additions and 2 deletions
|
|
@ -104,13 +104,13 @@ func (builder *PacketBuilder) MarshalAndSign(sharedSecret []byte) ([]byte, error
|
|||
|
||||
// writeTLV(buffer, TagVersion, []byte{0x09})
|
||||
// writeTLV(buffer, TagIntent, []byte{intentID})
|
||||
func writeTLV(writer io.Writer, tagByte uint8, tagValue []byte) error {
|
||||
func writeTLV(writer io.Writer, tagType uint8, tagValue []byte) error {
|
||||
// writeTLV(writer, TagVersion, bytes.Repeat([]byte("x"), 256)) → errTLVValueTooLarge
|
||||
if len(tagValue) > 255 {
|
||||
return errTLVValueTooLarge
|
||||
}
|
||||
|
||||
if _, err := writer.Write([]byte{tagByte}); err != nil {
|
||||
if _, err := writer.Write([]byte{tagType}); err != nil {
|
||||
return err
|
||||
}
|
||||
if _, err := writer.Write([]byte{uint8(len(tagValue))}); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue