CryptographicHash QML Type

Provides a way to generate cryptographic hashes. More...

Import Statement: import ArcGIS.AppFramework 1.0

Properties

Methods

Detailed Description

The CryptographicHash component provides a method to generate cryptographic hashes of binary or text data according to a series of supported algorithms. There is no functionality within the AppFramework to decrypt these hashes once encrypted, as they are intended for communication with external systems such as the Amazon Web Services REST API.

This code sample demonstrates usage of CryptographicHash. Enter text into the TextField, and the hashed result will be automatically displayed in the TextArea.

Item {
        CryptographicHash {
                id: hashObj
                algorithm: CryptographicHash.Md4
                data: input.text
        }

        Column {
                anchors.fill: parent

                TextField {
                        id: input
                        width: parent.width
                        placeholderText: qsTr("Text to hash")
                }

                TextField {
                        width: parent.width
                        text: qsTr ("Hash: %1").arg(hashObj.result.data.toString())
                        readOnly: true
                }
        }
}

Enumerations

Algorithm enumeration

This enum describes the cryptographic hashing algorithms that are supported. Informs the algorithm property.

NameValue
CryptographicHash.Unknown-1
CryptographicHash.Md40
CryptographicHash.Md51
CryptographicHash.Sha12
CryptographicHash.Sha_2243
CryptographicHash.Sha_2564
CryptographicHash.Sha_3845
CryptographicHash.Sha_5126
CryptographicHash.Keccak_2247
CryptographicHash.Keccak_2568
CryptographicHash.Keccak_3849
CryptographicHash.Keccak_51210
CryptographicHash.Sha3_22411
CryptographicHash.Sha3_25612
CryptographicHash.Sha3_38413
CryptographicHash.Sha3_51214

Property Documentation

algorithm : Algorithm

The algorithm being used to create the hash. Informed by the Algorithm enum.


data : object

The binary or text data to hash.


[read-only] error : string

Returns an error if the hashing process has failed.


hexOutput : bool

If true, the resulting hash will be output as hexidecimal. Default value is true.


[read-only] result : BinaryData

Returns the final hash value after the hashing process.


[read-only] resultValid : bool

Returns true if the result of the hashing process is valid. Otherwise, returns false.


Method Documentation

reset()

Resets the CryptographicHash object.


Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.