Обновление документации.

This commit is contained in:
2025-04-15 22:09:10 +04:00
parent 2fd6d787a0
commit 5068fe3069
26 changed files with 370 additions and 235 deletions

View File

@@ -1,7 +1,7 @@
use sha1::Digest;
use std::hash::Hasher;
/// Хешер возвращающий хеш из алгоритма реализующего Digest
/// Hesher returning hash from the algorithm implementing Digest
pub struct DigestHasher<D: Digest> {
digest: D,
}
@@ -10,7 +10,7 @@ impl<D> DigestHasher<D>
where
D: Digest,
{
/// Получение хеша
/// Obtain hash.
pub fn finalize(self) -> String {
hex::encode(self.digest.finalize().0)
}
@@ -20,14 +20,14 @@ impl<D> From<D> for DigestHasher<D>
where
D: Digest,
{
/// Создания хешера из алгоритма реализующего Digest
/// Creating a hash from an algorithm implementing Digest.
fn from(digest: D) -> Self {
DigestHasher { digest }
}
}
impl<D: Digest> Hasher for DigestHasher<D> {
/// Заглушка для предотвращения вызова стандартного результата Hasher
/// Stopper to prevent calling the standard Hasher result.
fn finish(&self) -> u64 {
unimplemented!("Do not call finish()");
}