mirror of
https://github.com/n08i40k/schedule-parser-rusted.git
synced 2025-12-06 17:57:47 +03:00
Обновление документации.
This commit is contained in:
@@ -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()");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user