mirror of
https://github.com/davegallant/rfd-notify.git
synced 2025-08-07 00:58:12 +00:00
Use sha2 package instead of rust-crypto (#214)
* Use sha2 package instead of rust-crypto * Bump rfd-notify version from 0.2.1 to 0.2.2
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
use crate::config::Config;
|
||||
use crate::db;
|
||||
use crate::mail;
|
||||
use crypto::digest::Digest;
|
||||
use crypto::sha2::Sha256;
|
||||
use regex::RegexBuilder;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sha2::{Digest, Sha256};
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct Deals {
|
||||
@@ -69,8 +68,9 @@ pub fn parse_posts(response: String) -> Posts {
|
||||
fn hash_deal(topic: &Topic) -> String {
|
||||
let digest = format!("{}{}{}", topic.web_path, topic.title, topic.post_time);
|
||||
let mut hasher = Sha256::new();
|
||||
hasher.input_str(&digest);
|
||||
hasher.result_str()
|
||||
hasher.update(digest);
|
||||
let result: String = format!("{:X}", hasher.finalize());
|
||||
result
|
||||
}
|
||||
|
||||
pub fn match_deals(deals: Deals, config: Config, dbpath: &str) {
|
||||
|
Reference in New Issue
Block a user