package obus
Install
Dune Dependency
Authors
Maintainers
Sources
md5=81eb1034c6ef4421a2368a9b352199de
sha512=4b540497188a7d78f4f14f94c6b7fdff47dd06436a34e650ff378dd77bb3e2acb7afd45cd72daf4ddba06e732e9944d560c2882dc37862f1b1f1bb6df37e6205
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.