From b9571c4785e227a45a29b1b6f3be6aa944b14e34 Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Wed, 24 Oct 2018 00:51:05 +0200 Subject: xxd: add binary-text conversion helper --- sid.ml | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'sid.ml') diff --git a/sid.ml b/sid.ml index bd8f9fb..f3fb77d 100644 --- a/sid.ml +++ b/sid.ml @@ -21,6 +21,9 @@ let create ?(sa=[||]) ia = if Array.length sa > max_subauth_count then None else Some (create_unsafe sa ia) +let get_ident_auth s = s.sid_ident_auth +let get_sub_auths s = s.sid_sub_auths + exception Nope let equal_sub_auths saa sab = @@ -36,25 +39,6 @@ let equal a b = && Array.length a.sid_sub_auths = Array.length b.sid_sub_auths && equal_sub_auths a.sid_sub_auths b.sid_sub_auths -module type Xtract = sig - type t - val nth_byte : t -> int -> int -end - -module MkExtract (INTTYPE : Stdint.Int) = struct - type t = INTTYPE.t - - let ilsr = INTTYPE.shift_left - let iland = INTTYPE.logand - let ixff = INTTYPE.of_string "255" - - let nth_byte n i = - (ilsr n i) |> iland ixff |> INTTYPE.to_int -end - -module U32Extract = MkExtract (U32) -module U64Extract = MkExtract (U64) - module StringFmt = struct let expect_char s c p = -- cgit v1.2.3