#[repr(C)]
pub struct QCryptographicHash { /* private fields */ }
Expand description

The QCryptographicHash class provides a way to generate cryptographic hashes.

C++ class: QCryptographicHash.

C++ documentation:

The QCryptographicHash class provides a way to generate cryptographic hashes.

QCryptographicHash can be used to generate cryptographic hashes of binary or text data.

Refer to the documentation of the QCryptographicHash::Algorithm enum for a list of the supported algorithms.

Implementations§

source§

impl QCryptographicHash

source

pub unsafe fn add_data_char_int(&self, data: *const c_char, length: c_int)

Adds the first length chars of data to the cryptographic hash.

Calls C++ function: void QCryptographicHash::addData(const char* data, int length).

C++ documentation:

Adds the first length chars of data to the cryptographic hash.

source

pub unsafe fn add_data_q_byte_array(&self, data: impl CastInto<Ref<QByteArray>>)

This function overloads addData().

Calls C++ function: void QCryptographicHash::addData(const QByteArray& data).

C++ documentation:

This function overloads addData().

source

pub unsafe fn add_data_q_io_device( &self, device: impl CastInto<Ptr<QIODevice>> ) -> bool

Reads the data from the open QIODevice device until it ends and hashes it. Returns true if reading was successful.

Calls C++ function: bool QCryptographicHash::addData(QIODevice* device).

C++ documentation:

Reads the data from the open QIODevice device until it ends and hashes it. Returns true if reading was successful.

This function was introduced in Qt 5.0.

source

pub unsafe fn hash( data: impl CastInto<Ref<QByteArray>>, method: Algorithm ) -> CppBox<QByteArray>

Returns the hash of data using method.

Calls C++ function: static QByteArray QCryptographicHash::hash(const QByteArray& data, QCryptographicHash::Algorithm method).

C++ documentation:

Returns the hash of data using method.

source

pub unsafe fn hash_length(method: Algorithm) -> c_int

Available on cpp_lib_version="5.12.2" or cpp_lib_version="5.13.0" or cpp_lib_version="5.14.0" only.

Returns the size of the output of the selected hash method in bytes.

Calls C++ function: static int QCryptographicHash::hashLength(QCryptographicHash::Algorithm method).

C++ documentation:

Returns the size of the output of the selected hash method in bytes.

This function was introduced in Qt 5.12.

source

pub unsafe fn new(method: Algorithm) -> CppBox<QCryptographicHash>

Constructs an object that can be used to create a cryptographic hash from data using method.

Calls C++ function: [constructor] void QCryptographicHash::QCryptographicHash(QCryptographicHash::Algorithm method).

C++ documentation:

Constructs an object that can be used to create a cryptographic hash from data using method.

source

pub unsafe fn reset(&self)

Resets the object.

Calls C++ function: void QCryptographicHash::reset().

C++ documentation:

Resets the object.

source

pub unsafe fn result(&self) -> CppBox<QByteArray>

Returns the final hash value.

Calls C++ function: QByteArray QCryptographicHash::result() const.

C++ documentation:

Returns the final hash value.

See also QByteArray::toHex().

source

pub unsafe fn static_meta_object() -> Ref<QMetaObject>

Returns a reference to the staticMetaObject field.

Trait Implementations§

source§

impl CppDeletable for QCryptographicHash

source§

unsafe fn delete(&self)

Destroys the object.

Calls C++ function: [destructor] void QCryptographicHash::~QCryptographicHash().

C++ documentation:

Destroys the object.

Auto Trait Implementations§

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, U> CastInto<U> for T
where U: CastFrom<T>,

source§

unsafe fn cast_into(self) -> U

Performs the conversion. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

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> StaticUpcast<T> for T

source§

unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>

Convert type of a const pointer. 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.