summaryrefslogtreecommitdiff
path: root/sid.ml
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2018-10-24 00:51:05 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2018-10-28 23:07:08 +0100
commitb9571c4785e227a45a29b1b6f3be6aa944b14e34 (patch)
tree7d3c89d9f58f8b91557bba03c18ee2b2899e0360 /sid.ml
parent694afd97792c870619b8cfb3db480a502fe408e0 (diff)
downloadocaml-sid-b9571c4785e227a45a29b1b6f3be6aa944b14e34.tar.gz
xxd: add binary-text conversion helper
Diffstat (limited to 'sid.ml')
-rw-r--r--sid.ml22
1 files changed, 3 insertions, 19 deletions
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 =