package bytesrw
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
Composable byte stream readers and writers for OCaml
Install
dune-project
Dependency
Authors
Maintainers
Sources
bytesrw-0.4.1.tbz
sha512=9d4d65ff080a107f2ed35c4f13ac77c20e4920e92dffe84c270f23169d7db130506a450aa83a6c6c621ce80b699191291fb8be227d1fb47fb5fd49ddc150b37e
doc/CHANGES.html
v0.4.1 2026-09-12 Zagreb
- Add
Bytes.Writer.make'which allows to access the writer in the write function. - Fix
Bytesrw_fmt.Slice.pp' ~head:true, the ellipsis could be missing on truncated output. Thanks to Anil Madhavapeddy for the report. - Fix
Bytes.Slice.of_bigbytes_or_eodon empty ranges. It raisedInvalid_argumentinstead of returningeod. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Bytes.Reader.emptyignoring itsposandslice_lengthoptional argument. Indirectly affected the result ofBytes.Reader.{of_bytes,of_string,of_slice,sub}when those would return an empty stream reader. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Bytes.Writer.limitfilter raisingInvalid_argumentinstead of aStream.Limiterror if the last write is exactly in the limit but the next one blows it (#15). Thanks to Vladimir N. Silyaev and Anil Madhavapeddy for the report and the fix. - Fix
Bytes.Writer.limitresulting's writerWriter.posfinal value. Cap it at what is supposed to be seen by the limit. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Bytesrw_zstd.decompress_writesposition error reporting. The reported positions were in the decompressed stream rather than in the compressed stream. - Fix
Bytesrw_sysrandompotential unwarranted panics on Linux due to shortgetrandomresults orEINTR. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Bytesrw_xxhash.Xxhash_128.updateusingXxhash_64.update. This doesn't change previously generated hashes as libxxahsh 0.8.x use the same implementation for both. Thanks to Anil Madhavapeddy for the report and the fix.
Bytesrw_crypto
- Add
Psa.Alg.is_tls12_psk_to_mswrongly assumed not to be in TF-PSA-Crypto due to a typo. Thanks to Anil Madhavapeddy for the report and the fix. - Fix C binding to
Psa.Alg.is_rsa_oaepandPsa.Mac.max_size, they were returning garbage. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Psa.Key_agreement.raw_output_sizereturning garbage due to aVal_longused instead ofLong_val. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Psa.Key_lifetime.from_persistaence_and_location, the components were combined withlogandinstead oflogor. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Psa.Aead.decryptstub in bytecode, it was calling theencryptstub. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Psa.Key_type.is_{public_key,key_pair}. They were implemented asis_assymetric. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Psa.Status.messagehave a user friendly message forError.{insufficient_entropy,invalid_padding}. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Psa.Alg.pp,SHA3-512was printed asSHA3-256. to Anil Madhavapeddy for the report and the fix. - Fix
Psa.Key_type.ppDH key-pairs where printed as an unknown key type. Thanks to Anil Madhavapeddy for the report and the fix. - Rename inexisting name
Psa.Alg.cbctoPsa.Alg.cmac. Thanks to Anil Madhavapeddy for the report and the fix.
Bytesrw_tls
- Fix
Bytesrw_tlsreader and writer, reading and writing beyond slice lengths. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Bytesrw_tls.X509_certchain.{self_signed,ca_signed}memory leak. Thanks to Anil Madhavapeddy for the report and the fix. - Fix
Bytesrw_tls.X509_certchain.Private_key.write_pem_file. The C function handling the write was not zeroing a temporary stack allocated buffer holding the private key. Thanks to Anil Madhavapeddy for the report.
Bytesrw_zlib
- Improve
Bytesrw_zliberror reporting. Thanks to Anil Madhavapeddy for the fix. - Fix
Bytesrw_zlib.{Deflate,Zlib,Ggzip}.decompress_writesposition error reporting. The reported positions were in the decompressed stream rather than in the compressed stream. Thanks to Anil Madhavapeddy for the report. - Fix
Bytesrw_zlib.Gzip.decompress_writesaccepting a truncated last member intead of erroring. Thanks to Anil Madhavapeddy for the report and the fix.
v0.4.0 2026-08-22 Zagreb
- Add
Bytes.Writer.writes_to_string - Add
Bytes.Slice.{take,drop}_first_or_eod(#11). - Deprecate
Bytes.Slice.{take,drop,break}in favor ofBytes.Slice.{take_first,drop_first,cut_first}to align on the stdlib's newStringterminology (#11). - Fix
Bytes.Slice.compare. The last byte of equal length slices was not compared (#14). Thanks to Anil Madhavapeddy for the report. - Fix
Bytes.Reader.of_slicewhen the given slice does not start at 0 (#13). Thanks to Thomas Gazagnaire for report. Bytesrw_sysrandom: fix headers for musl libc (alpine) (#7)
v0.3.0 2025-11-04 Zagreb
- Add the
Bytesrw_sysrandommodule for operating system provided cryptographically secure pseudorandom byte streams and an entropy primitive. - Add the optional
Bytesrw_crypto.Psamodule for low-level cryptographic operations on byte slices. These are thin and safe bindings to the PSA Crypto API specification currently provided by the TF-PSA-Crypto C library distributed with Mbed TLS. - Add the optional
Bytesrw_cryptomodule for higher-level cryptographic operations implemented overBytesrw_crypto.Psa. Mostly hashing for now. Use this if you need SHA-3 hashes. - Add the optional
Bytesrw_tlsa module for TLS encrypted streams and the needed X.509 certificate management (including system lookups for trusted CAs). The backend is provided by the Mbed TLS C library. - Add
Bytesrw_unix.bytes_writer_of_socket_fdwhich shutdowns the fd in the send direction when the end of stream is written. - Add
Bytes.Slice.last. - Review
Int_valvsLong_valin C bindings. AffectsBytesrw_blake3,Bytesrw_md,Bytesrw_xxh,Bytesrw_zlib,Bytesrw_zstd
v0.2.0 2025-07-25 Zagreb
- Fix
Bytesrw_xxhash.Xxh64.{to_hex,pp}. Leading zeros were not being printed (#5). - Change unuseful signature of
Slice.break: do not returnNoneif any ofSlice.takeorSlice.dropdoes. Simply return the result of both operations. - Fix wrong bound checks in
Slice.{sub,make}[_or_eod]. The functions now behave likeBytes.subas far as indexing is allowed. Thanks to Adrián Montesinos González for the report and suggesting the fix (#4). bytesrw.*libraries are made to exportbytesrw.
v0.1.0 2024-11-28 Zagreb
First release.
Supported by a grant from the OCaml Software Foundation.
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page