From a626ab534224cc244d58259e622b9a59703223f6 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Sat, 27 Oct 2018 22:17:16 +0200 Subject: sid: optionally handle big endian in packet format codec MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Oddly enough this only has an effect on the sub_auths since the 48 bits of “identifier authority” are always handled in big endian. --- sid.mli | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sid.mli') diff --git a/sid.mli b/sid.mli index 7c0451c..12d31a9 100644 --- a/sid.mli +++ b/sid.mli @@ -9,16 +9,15 @@ val get_sub_auths : t -> sub_auths module StringFmt : sig - val decode : string -> t - val from_string_res : string -> (t, string) result - val from_string_opt : string -> t option + val decode : string -> (t, string result) val encode : t -> string end module PacketRep : sig - val encode : t -> bytes - val decode : bytes -> (t, string) result + type endian = Big | Little + val encode : ?endian:endian -> t -> bytes + val decode : ?endian:endian -> bytes -> (t, string) result end module WellKnown : -- cgit v1.2.3