pub fn validate(secret: &[u8], signature: &[u8], message: &[u8]) -> bool {
    let mut hmac = Hmac::<Sha1>::new_varkey(secret)
        .expect("HMAC can take key of any size");
    hmac.update(message);
    hmac.verify(signature).is_ok()
}
/// Check a signature and a message against a shared secret.
///
/// Note that if you get the signature from the `X-Hub-Signature` header, you'll need to convert it
/// to bytes via hex. Use the `rustc_serialize` `From_Hex` trait to do this.
///
/// # Examples
///
/// ```
/// use github_webhook_message_validator::validate;
///
/// let signature = &vec![
///     115, 109, 127, 147, 66, 242, 167, 210, 57, 175, 165, 81, 58, 75, 178, 40, 62, 14, 21, 136
/// ];
/// let secret = b"some-secret";
/// let message = b"blah-blah-blah";
///
/// assert_eq!(validate(secret, signature, message), true);
/// ```
Check a signature and a message against a shared secret.
Note that if you get the signature from the `X-Hub-Signature` header, you'll need to convert it
to bytes via hex. Use the `rustc_serialize` `From_Hex` trait to do this.
Check a signature and a message against a shared secret . Note that if you get the signature from the ` X - Hub - Signature ` header you ' ll need to convert it to bytes via hex . Use the ` rustc_serialize ` ` From_Hex ` trait to do this .
pub fn validate(secret: &[u8], signature: &[u8], message: &[u8]) -> bool {
    let mut hmac = Hmac::<Sha1>::new_varkey(secret)
        .expect("HMAC can take key of any size");
    hmac.update(message);
    hmac.verify(signature).is_ok()
}
pub fn validate ( secret : & [ u8 ] , signature : & [ u8 ] , message : & [ u8 ] ) -> bool { let mut hmac = Hmac :: < Sha1 > :: new_varkey ( secret ) . expect ( " " ) ; hmac . update ( message ) ; hmac . verify ( signature ) . is_ok ( ) }
Check a signature and a message against a shared secret.
Check a signature and a message against a shared secret .
secret
&[u8]
signature
&[u8]
message
&[u8]
secret
&[u8]
signature
&[u8]
message
&[u8]
examples
```
use github_webhook_message_validator::validate.



assert_eq!(validate(secret, signature, message), true);
```
` ` ` use github_webhook_message_validator :: validate . assert_eq! ( validate ( secret signature message ) true ) ; ` ` `