mirleft / ocaml-asn1-combinators

Embed typed ASN.1 grammars in OCaml
ISC License
35 stars 20 forks source link

Provide Asn.S.unsigned_integer, which includes transformations to unsigned int #44

Closed hannesm closed 5 months ago

hannesm commented 5 months ago

This embeds the code to strip superfluous leading 0s, adds a leading 0 if required - and the decoding side ensures that the value is an unsigned integer, and strips of the potentially leading 0.

see https://github.com/mirleft/ocaml-x509/issues/168 https://github.com/mirleft/ocaml-x509/pull/167/commits/93d267401b377a9b7f814eae397c37d35bd500f5 https://github.com/mirleft/ocaml-x509/pull/167/commits/bcb9f135c5f929d47082152ce5119da7c9182388#diff-c5ef94a5fb6c796edc65f18a442756732566a4729ad4ab5ec8489e6481806ea1 for the motivation.