This commit is contained in:
debris
2017-08-31 11:35:41 +02:00
parent f0e8abb07b
commit 7849fff41e
43 changed files with 130 additions and 95 deletions

View File

@@ -9,7 +9,8 @@ use std::thread;
use std::time;
use std::path::PathBuf;
use util::{Hashable, Mutex};
use hash::keccak;
use util::Mutex;
use url::Url;
use std::fs::File;
@@ -72,7 +73,7 @@ impl Handler for RpcHandler {
WsError::new(WsErrorKind::Internal, format!("{}", err))
})?;
let secs = timestamp.as_secs();
let hashed = format!("{}:{}", self.auth_code, secs).sha3();
let hashed = keccak(format!("{}:{}", self.auth_code, secs));
let proto = format!("{:?}_{}", hashed, secs);
r.add_protocol(&proto);
Ok(r)

View File

@@ -11,6 +11,7 @@ extern crate serde;
extern crate serde_json;
extern crate tempdir;
extern crate url;
extern crate hash;
#[macro_use]
extern crate log;