Struct qt_core::QCryptographicHash
source · #[repr(C)]pub struct QCryptographicHash { /* private fields */ }
Expand description
The QCryptographicHash class provides a way to generate cryptographic hashes.
C++ class: QCryptographicHash
.
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
impl QCryptographicHash
sourcepub unsafe fn add_data_char_int(&self, data: *const c_char, length: c_int)
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)
.
Adds the first length chars of data to the cryptographic hash.
sourcepub unsafe fn add_data_q_byte_array(&self, data: impl CastInto<Ref<QByteArray>>)
pub unsafe fn add_data_q_byte_array(&self, data: impl CastInto<Ref<QByteArray>>)
sourcepub unsafe fn add_data_q_io_device(
&self,
device: impl CastInto<Ptr<QIODevice>>
) -> bool
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)
.
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.
sourcepub unsafe fn hash(
data: impl CastInto<Ref<QByteArray>>,
method: Algorithm
) -> CppBox<QByteArray>
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)
.
Returns the hash of data using method.
sourcepub 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.
pub unsafe fn hash_length(method: Algorithm) -> c_int
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)
.
Returns the size of the output of the selected hash method in bytes.
This function was introduced in Qt 5.12.
sourcepub unsafe fn new(method: Algorithm) -> CppBox<QCryptographicHash>
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)
.
Constructs an object that can be used to create a cryptographic hash from data using method.
sourcepub unsafe fn reset(&self)
pub unsafe fn reset(&self)
Resets the object.
Calls C++ function: void QCryptographicHash::reset()
.
Resets the object.
sourcepub unsafe fn result(&self) -> CppBox<QByteArray>
pub unsafe fn result(&self) -> CppBox<QByteArray>
Returns the final hash value.
Calls C++ function: QByteArray QCryptographicHash::result() const
.
Returns the final hash value.
See also QByteArray::toHex().
sourcepub unsafe fn static_meta_object() -> Ref<QMetaObject>
pub unsafe fn static_meta_object() -> Ref<QMetaObject>
Returns a reference to the staticMetaObject
field.