data-items-cleanup #203

Merged
lash merged 12 commits from data-items-cleanup into master 2024-12-05 16:03:50 +01:00
Showing only changes of commit a659fb06fa - Show all commits

View File

@ -88,3 +88,10 @@ func (d DataTyp) ToBytes() []byte {
binary.BigEndian.PutUint16(bytes, uint16(d)) binary.BigEndian.PutUint16(bytes, uint16(d))
return bytes return bytes
} }
// Convert int to []byte
func IntToBytes(value int) []byte {
bytes := make([]byte, 2)
binary.BigEndian.PutUint16(bytes, uint16(value))
return bytes
}