package obus
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=75703f78015e15d03d0fdba1633a155875daf17d854225658429e72a0df06258
md5=3090a796f0af95e16838d81656ac4b97
doc/obus.internals/OBus_util/index.html
Module OBus_util
Source
This module contain various functions used by both the library and the tools
Same as List.assoc but return an option
Same as List.assq but return an option
find_map f l
Apply f
on each element of l
until it return Some x
and return that result or return None
filter_map f l
apply f
on each element of l
and return the list ef element for which f
succeed (i.e. return Some x
)
part_map f l
apply f
on each element of l
and return the list of success and the list of failure
Compute the sha1 of a string
A hex-encoded string is a string where each character is replaced by two hexadecimal characters which represent his ascii code
Random number generation
All the following functions try to generate random numbers using /dev/urandom and can fallback to pseudo-random generator
fill_random str ofs len
Fill the given string from ofs
to ofs+len-1
with random bytes.