Struct crypto::sha1::Sha1

source ·
pub struct Sha1;

Implementations§

source§

impl Sha1

source

const H0: u32 = 1_732_584_193u32

source

const H1: u32 = 4_023_233_417u32

source

const H2: u32 = 2_562_383_102u32

source

const H3: u32 = 271_733_878u32

source

const H4: u32 = 3_285_377_520u32

source

pub fn hash(key: &[u8]) -> [u8; 20]

Computes the SHA-1 hash of the input string by taking in either a String of str type.

source

fn pad_message(input: &[u8]) -> Vec<u8>

Pads the input message according to SHA-1 specifications.

source

fn build_schedule(chunk: &[u8]) -> [u32; 80]

Builds the message schedule array from a 512-bit chunk.

Trait Implementations§

source§

impl Clone for Sha1

source§

fn clone(&self) -> Sha1

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for Sha1

source§

fn default() -> Sha1

Returns the “default value” for a type. Read more
source§

impl PartialEq for Sha1

source§

fn eq(&self, other: &Sha1) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Sha1

source§

impl StructuralPartialEq for Sha1

Auto Trait Implementations§

§

impl Freeze for Sha1

§

impl RefUnwindSafe for Sha1

§

impl Send for Sha1

§

impl Sync for Sha1

§

impl Unpin for Sha1

§

impl UnwindSafe for Sha1

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> FromLossy<T> for U
where U: From<T>,

§

fn from_lossy(t: T) -> U

Convert to this type lossily
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T, U> IntoLossy<T> for U
where T: FromLossy<U>,

§

fn into_lossy(self) -> T

Convert this type lossily
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.