All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.qt.core.QCryptographicHash Maven / Gradle / Ivy

There is a newer version: 6.8.0
Show newest version
package io.qt.core;

import io.qt.*;


/**
 * 

Way to generate cryptographic hashes

*

Java wrapper for Qt class QCryptographicHash

*/ public class QCryptographicHash extends QtObject { static { QtJambi_LibraryUtilities.initialize(); } /** * This variable stores the meta-object for the class. */ public static final io.qt.core.@NonNull QMetaObject staticMetaObject = io.qt.core.QMetaObject.forType(QCryptographicHash.class); /** *

Java wrapper for Qt enum QCryptographicHash::Algorithm

*/ @QtRejectedEntries({"RealSha3_224", "RealSha3_256", "RealSha3_384", "RealSha3_512"}) public enum Algorithm implements QtEnumerator { /** *

Representing QCryptographicHash::Md4

*/ Md4(0), /** *

Representing QCryptographicHash::Md5

*/ Md5(1), /** *

Representing QCryptographicHash::Sha1

*/ Sha1(2), /** *

Representing QCryptographicHash::Sha224

*/ Sha224(3), /** *

Representing QCryptographicHash::Sha256

*/ Sha256(4), /** *

Representing QCryptographicHash::Sha384

*/ Sha384(5), /** *

Representing QCryptographicHash::Sha512

*/ Sha512(6), /** *

Representing QCryptographicHash::Keccak_224

*/ Keccak_224(7), /** *

Representing QCryptographicHash::Keccak_256

*/ Keccak_256(8), /** *

Representing QCryptographicHash::Keccak_384

*/ Keccak_384(9), /** *

Representing QCryptographicHash::Keccak_512

*/ Keccak_512(10), /** *

Representing QCryptographicHash::RealSha3_224

*/ RealSha3_224(11), /** *

Representing QCryptographicHash::RealSha3_256

*/ RealSha3_256(12), /** *

Representing QCryptographicHash::RealSha3_384

*/ RealSha3_384(13), /** *

Representing QCryptographicHash::RealSha3_512

*/ RealSha3_512(14), /** *

Representing QCryptographicHash::Sha3_224

*/ Sha3_224(11), /** *

Representing QCryptographicHash::Sha3_256

*/ Sha3_256(12), /** *

Representing QCryptographicHash::Sha3_384

*/ Sha3_384(13), /** *

Representing QCryptographicHash::Sha3_512

*/ Sha3_512(14), /** *

Representing QCryptographicHash::Blake2b_160

*/ Blake2b_160(15), /** *

Representing QCryptographicHash::Blake2b_256

*/ Blake2b_256(16), /** *

Representing QCryptographicHash::Blake2b_384

*/ Blake2b_384(17), /** *

Representing QCryptographicHash::Blake2b_512

*/ Blake2b_512(18), /** *

Representing QCryptographicHash::Blake2s_128

*/ Blake2s_128(19), /** *

Representing QCryptographicHash::Blake2s_160

*/ Blake2s_160(20), /** *

Representing QCryptographicHash::Blake2s_224

*/ Blake2s_224(21), /** *

Representing QCryptographicHash::Blake2s_256

*/ Blake2s_256(22), /** *

Representing QCryptographicHash::NumAlgorithms

*/ NumAlgorithms(23); static { QtJambi_LibraryUtilities.initialize(); } private Algorithm(int value) { this.value = value; } /** * {@inheritDoc} */ public int value() { return value; } /** * Returns the corresponding enum entry for the given value. * @param value * @return enum entry */ public static @NonNull Algorithm resolve(int value) { switch (value) { case 0: return Md4; case 1: return Md5; case 2: return Sha1; case 3: return Sha224; case 4: return Sha256; case 5: return Sha384; case 6: return Sha512; case 7: return Keccak_224; case 8: return Keccak_256; case 9: return Keccak_384; case 10: return Keccak_512; case 11: return Sha3_224; case 12: return Sha3_256; case 13: return Sha3_384; case 14: return Sha3_512; case 15: return Blake2b_160; case 16: return Blake2b_256; case 17: return Blake2b_384; case 18: return Blake2b_512; case 19: return Blake2s_128; case 20: return Blake2s_160; case 21: return Blake2s_224; case 22: return Blake2s_256; case 23: return NumAlgorithms; default: throw new QNoSuchEnumValueException(value); } } private final int value; } /** *

See QCryptographicHash::QCryptographicHash(QCryptographicHash::Algorithm)

*/ public QCryptographicHash(io.qt.core.QCryptographicHash.@NonNull Algorithm method){ super((QPrivateConstructor)null); initialize_native(this, method); } private native static void initialize_native(QCryptographicHash instance, io.qt.core.QCryptographicHash.Algorithm method); /** *

See QCryptographicHash::addData(QByteArrayView)

*/ @QtUninvokable public final void addData(io.qt.core.@NonNull QByteArrayView data){ addData_native_QByteArrayView(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(data)); } @QtUninvokable private native void addData_native_QByteArrayView(long __this__nativeId, long data); /** *

See QCryptographicHash::addData(QIODevice*)

*/ @QtUninvokable public final boolean addData(io.qt.core.@Nullable QIODevice device){ return addData_native_QIODevice_ptr(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(device)); } @QtUninvokable private native boolean addData_native_QIODevice_ptr(long __this__nativeId, long device); /** *

See QCryptographicHash::addData(const char*,qsizetype)

*/ @QtUninvokable public final void addData(java.nio.@StrictNonNull ByteBuffer data){ java.util.Objects.requireNonNull(data, "Argument 'data': null not expected."); addData_native_const_char_ptr_qsizetype(QtJambi_LibraryUtilities.internal.nativeId(this), data); } @QtUninvokable private native void addData_native_const_char_ptr_qsizetype(long __this__nativeId, java.nio.ByteBuffer data); /** *

See QCryptographicHash::algorithm()const

*/ @QtUninvokable public final io.qt.core.QCryptographicHash.@NonNull Algorithm algorithm(){ return io.qt.core.QCryptographicHash.Algorithm.resolve(algorithm_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this))); } @QtUninvokable private native int algorithm_native_constfct(long __this__nativeId); /** *

See QCryptographicHash::reset()

*/ @QtUninvokable public final void reset(){ reset_native(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native void reset_native(long __this__nativeId); /** *

See QCryptographicHash::result()const

*/ @QtUninvokable public final io.qt.core.@NonNull QByteArray result(){ return result_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native io.qt.core.QByteArray result_native_constfct(long __this__nativeId); /** *

See QCryptographicHash::resultView()const

*/ @QtUninvokable public final io.qt.core.@NonNull QByteArrayView resultView(){ return resultView_native_constfct(QtJambi_LibraryUtilities.internal.nativeId(this)); } @QtUninvokable private native io.qt.core.QByteArrayView resultView_native_constfct(long __this__nativeId); /** *

See QCryptographicHash::swap(QCryptographicHash&)

*/ @QtUninvokable public final void swap(io.qt.core.@StrictNonNull QCryptographicHash other){ java.util.Objects.requireNonNull(other, "Argument 'other': null not expected."); swap_native_ref_QCryptographicHash(QtJambi_LibraryUtilities.internal.nativeId(this), QtJambi_LibraryUtilities.internal.checkedNativeId(other)); } @QtUninvokable private native void swap_native_ref_QCryptographicHash(long __this__nativeId, long other); /** *

See QCryptographicHash::hash(QByteArrayView,QCryptographicHash::Algorithm)

*/ public static io.qt.core.@NonNull QByteArray hash(io.qt.core.@NonNull QByteArrayView data, io.qt.core.QCryptographicHash.@NonNull Algorithm method){ return hash_native_QByteArrayView_QCryptographicHash_Algorithm(QtJambi_LibraryUtilities.internal.checkedNativeId(data), method.value()); } private native static io.qt.core.QByteArray hash_native_QByteArrayView_QCryptographicHash_Algorithm(long data, int method); /** *

See QCryptographicHash::hashLength(QCryptographicHash::Algorithm)

*/ public static int hashLength(io.qt.core.QCryptographicHash.@NonNull Algorithm method){ return hashLength_native_QCryptographicHash_Algorithm(method.value()); } private native static int hashLength_native_QCryptographicHash_Algorithm(int method); /** *

See QCryptographicHash::supportsAlgorithm(QCryptographicHash::Algorithm)

*/ public static boolean supportsAlgorithm(io.qt.core.QCryptographicHash.@NonNull Algorithm method){ return supportsAlgorithm_native_QCryptographicHash_Algorithm(method.value()); } private native static boolean supportsAlgorithm_native_QCryptographicHash_Algorithm(int method); /** * Constructor for internal use only. * @param p expected to be null. * @hidden */ @NativeAccess protected QCryptographicHash(QPrivateConstructor p) { super(p); } /** *

Overloaded function for {@link #addData(io.qt.core.QByteArrayView)}.

*/ @QtUninvokable public final void addData(QByteArray data) { addData(new io.qt.core.QByteArrayView(data)); } /** *

Overloaded function for {@link #addData(java.nio.ByteBuffer)}.

*/ @QtUninvokable public final void addData(byte @StrictNonNull[] data, int offsetOfData, int length) { addData(data==null ? null : java.nio.ByteBuffer.wrap(data, offsetOfData, length)); } /** *

Overloaded function for {@link #addData(java.nio.ByteBuffer)}.

*/ @QtUninvokable public final void addData(byte @StrictNonNull[] data) { addData(data==null ? null : java.nio.ByteBuffer.wrap(data)); } /** *

Overloaded function for {@link #hash(io.qt.core.QByteArrayView, io.qt.core.QCryptographicHash.Algorithm)}.

*/ public static io.qt.core.@NonNull QByteArray hash(io.qt.core.@NonNull QByteArray data, io.qt.core.QCryptographicHash.@NonNull Algorithm method) { return hash(new io.qt.core.QByteArrayView(data), method); } /** *

Overloaded function for {@link #hash(io.qt.core.QByteArrayView, io.qt.core.QCryptographicHash.Algorithm)}.

*/ public static io.qt.core.@NonNull QByteArray hash(java.nio.@NonNull ByteBuffer data, io.qt.core.QCryptographicHash.@NonNull Algorithm method) { return hash(new io.qt.core.QByteArrayView(data), method); } /** *

Overloaded function for {@link #hash(io.qt.core.QByteArrayView, io.qt.core.QCryptographicHash.Algorithm)}.

*/ public static io.qt.core.@NonNull QByteArray hash(byte @NonNull[] data, io.qt.core.QCryptographicHash.@NonNull Algorithm method) { return hash(new io.qt.core.QByteArrayView(data), method); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy