Skip to content

Commit

Permalink
print_pkey: show number of packets
Browse files Browse the repository at this point in the history
  • Loading branch information
ygrek committed Jun 24, 2020
1 parent 591a783 commit a1ec6dd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions keyMerge.ml
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,21 @@ let flatten key =

(************************************************************)

let nr_packets l = List.fold_left ~f:(fun acc (_,l) -> acc + List.length l) ~init:0 l

let print_pkey key =
printf "%d selfsigs, %d uids, %d subkeys\n"
let uid =
match List.filter ~f:(fun (p,_) -> p.packet_type = User_ID_Packet) key.uids with
| [] -> ""
| (h,_)::_ -> h.packet_body
in
printf "%S : %d selfsigs, %d uids (%d packets), %d subkeys (%d packets)\n"
uid
(List.length key.selfsigs)
(List.length key.uids)
(nr_packets key.uids)
(List.length key.subkeys)

(nr_packets key.subkeys)

(*******************************************************************)

Expand Down

0 comments on commit a1ec6dd

Please sign in to comment.