impl Hash for Signature
This commit is contained in:
parent
8bd0034ced
commit
2cc2bd6518
@ -18,6 +18,7 @@ use std::ops::{Deref, DerefMut};
|
|||||||
use std::cmp::PartialEq;
|
use std::cmp::PartialEq;
|
||||||
use std::{mem, fmt};
|
use std::{mem, fmt};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
use std::hash::{Hash, Hasher};
|
||||||
use secp256k1::{Message as SecpMessage, RecoverableSignature, RecoveryId, Error as SecpError};
|
use secp256k1::{Message as SecpMessage, RecoverableSignature, RecoveryId, Error as SecpError};
|
||||||
use secp256k1::key::{SecretKey, PublicKey};
|
use secp256k1::key::{SecretKey, PublicKey};
|
||||||
use rustc_serialize::hex::{ToHex, FromHex};
|
use rustc_serialize::hex::{ToHex, FromHex};
|
||||||
@ -114,6 +115,12 @@ impl Default for Signature {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Hash for Signature {
|
||||||
|
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||||
|
H520::from(self.0).hash(state);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<[u8; 65]> for Signature {
|
impl From<[u8; 65]> for Signature {
|
||||||
fn from(s: [u8; 65]) -> Self {
|
fn from(s: [u8; 65]) -> Self {
|
||||||
Signature(s)
|
Signature(s)
|
||||||
|
Loading…
Reference in New Issue
Block a user