cfx_rpc_cfx_types/
subscriber_id.rsuse cfx_types::H64;
use std::str;
#[derive(Debug, Clone, Hash, Eq, PartialEq)]
pub struct SubId(H64);
impl str::FromStr for SubId {
    type Err = String;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        if s.starts_with("0x") {
            Ok(SubId(s[2..].parse().map_err(|e| format!("{}", e))?))
        } else {
            Err("The id must start with 0x".into())
        }
    }
}
impl SubId {
    pub fn new(data: H64) -> Self { SubId(data) }
    pub fn as_string(&self) -> String { format!("{:?}", self.0) }
}
pub mod random {
    use rand_07;
    pub type Rng = rand_07::rngs::OsRng;
    pub fn new() -> Rng { rand_07::rngs::OsRng }
}