moov-io / iso8583

A golang implementation to marshal and unmarshal iso8583 message.
https://moov.io
Apache License 2.0
304 stars 100 forks source link

New HexNumeric field #302

Closed madhr closed 6 months ago

madhr commented 7 months ago

It would be useful to introduce a new HexNumeric field that would allow to store binary encoded fields as hex numeric fields.

It's related to this change: https://github.com/moov-io/iso8583/pull/227 where it's now possible to treat binary encoded fields as Hex.

Since Hex is a string field, it's a bit inconvenient for fields that store numeric values like amounts (for instance DE55.9F02). Introducing the HexNumeric allows to convert the binary encoded fields straight into a hex numeric field that allows further arithmetic operations without extra conversion.

I've submitted a pull request here: https://github.com/moov-io/iso8583/pull/301