Digest32
Holds an N-bit digest (or any fixed-size bit sequence). This is the pure-Kotlin port of libtorrent's digest32<N> (sha1_hash.hpp). In libtorrent this is used for info-hashes, piece hashes, peer IDs, DHT node IDs, etc.
Backed by a ByteArray in big-endian (network) byte order, which is how all these values travel on the wire and in .torrent files. The type is immutable: every bit operation returns a fresh Digest32.
libtorrent fixes the width at compile time via the N template parameter; here the width is carried by the instance and the Sha1Hash/Sha256Hash aliases plus the sha1/sha256 factories document intent at call sites.