Select the types of activity you want to include in your feed.
fix(ocaml-requests): update tests and fuzz for cstruct→Bytes migration
Test files still referenced Cstruct.t where the API now uses bytes. Fixed all H2 frame, HPACK, client, and connection tests. Fixed fuzz test. 330 tests pass.
···99type t = {
1010 taps : int;
1111 width : int;
1212- mask : int; (* width-bit mask *)
1212+ mask : int; (* width-bit mask *)
1313 mutable state : int;
1414}
15151616-let pp ppf t = Format.fprintf ppf "lfsr(%d, 0x%0*X)" t.width (t.width / 4) t.state
1616+let pp ppf t =
1717+ Format.fprintf ppf "lfsr(%d, 0x%0*X)" t.width (t.width / 4) t.state
17181819let v ~taps ~seed ~width =
1920 if width < 1 || width > 62 then
···3637 Seed: all ones.
37383839 Byte packing: MSB-first (first output bit goes to bit 7 of first byte). *)
3939-let ccsds_oid () =
4040- v ~taps:0xC0000401 ~seed:0xFFFFFFFF ~width:32
4040+let ccsds_oid () = v ~taps:0xC0000401 ~seed:0xFFFFFFFF ~width:32
41414242(* Parity of an int (1 if odd number of set bits, 0 if even). *)
4343let[@inline] parity x =
···5252let[@inline] step t =
5353 let output = t.state land 1 in
5454 let feedback = parity (t.state land t.taps) in
5555- t.state <- ((t.state lsr 1) lor (feedback lsl (t.width - 1))) land t.mask;
5555+ t.state <- (t.state lsr 1) lor (feedback lsl (t.width - 1)) land t.mask;
5656 output
57575858(* CCSDS uses MSB-first bit packing: first output bit goes to bit 7. *)
+10-10
lib/lfsr.mli
···3131(** {1 Creation} *)
32323333val v : taps:int -> seed:int -> width:int -> t
3434-(** [v ~taps ~seed ~width] creates an LFSR with the given tap mask,
3535- initial seed, and register width (number of cells, 1–62).
3434+(** [v ~taps ~seed ~width] creates an LFSR with the given tap mask, initial
3535+ seed, and register width (number of cells, 1–62).
36363737 [taps] is a bitmask of the tap positions. The feedback bit is the XOR
3838- (parity) of all tapped bit positions. On each step the register shifts
3939- right by one and the feedback bit enters at position [width - 1].
3838+ (parity) of all tapped bit positions. On each step the register shifts right
3939+ by one and the feedback bit enters at position [width - 1].
40404141 @raise Invalid_argument if [width] is not in [1, 62]. *)
4242···4949 - Width: 32
5050 - Byte packing: MSB-first
51515252- The LFSR is initialized once and runs continuously — it is {b not}
5353- restarted between OID frames. *)
5252+ The LFSR is initialized once and runs continuously — it is {b not} restarted
5353+ between OID frames. *)
54545555(** {1 Stepping} *)
5656···5959 The output bit is the LSB of the register before the shift. *)
60606161val next_byte : t -> int
6262-(** [next_byte t] advances the LFSR by 8 steps and returns the next byte
6363- of pseudo-noise (0–255). Bits are packed MSB-first (first output bit
6464- goes to bit 7), matching CCSDS convention. *)
6262+(** [next_byte t] advances the LFSR by 8 steps and returns the next byte of
6363+ pseudo-noise (0–255). Bits are packed MSB-first (first output bit goes to
6464+ bit 7), matching CCSDS convention. *)
65656666(** {1 Bulk generation} *)
67676868val fill : t -> bytes -> off:int -> len:int -> unit
6969-(** [fill t buf ~off ~len] fills [buf.\[off\]] to [buf.\[off+len-1\]] with
6969+(** [fill t buf ~off ~len] fills [buf.[off]] to [buf.[off+len-1]] with
7070 pseudo-noise from the LFSR. *)
71717272val generate : t -> int -> bytes