wtx 0.44.1

A collection of different transport implementations and related tools focused primarily on web technologies.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::crypto::{Hash, Sha1DigestRustCrypto};
use sha1::Digest;

impl Hash for Sha1DigestRustCrypto {
  type Digest = [u8; 20];

  #[inline]
  fn digest<'data>(data: impl IntoIterator<Item = &'data [u8]>) -> Self::Digest {
    let mut ctx = <sha1::Sha1 as Digest>::new();
    for elem in data {
      ctx.update(elem);
    }
    ctx.finalize().into()
  }
}