Skip to main content

Calculation of hash values

This time, I will explain how to have a hash of text and file data and calculate the hash value.

About hash

Hashing is a technology that generates a unique string through a specific function.

If you have a hash of the same data, the same hash value is calculated, but the hash value is different for different data.

It can prove that the data is the same without confirming that all the data is completely matched, so it is used to make sure that the data is not falsified.

The original data cannot be derived from the hash value.

Action to use

This time, we use the action of "have a hash of text".

"Hashed text" Action details

The action has the following parameters.

Parameter namevalue
Hash algorithmAlgorithm used for hashe
EncodingHashed text character code
Hashed textText to be hashed

action

Implement the action

Add a sample flow with copy and paste

This time, as a sample, we have prepared a flow that calculates the hash value from the specified text data.

Copy the following code and paste it on the edit screen of Power Automate Desktop to add the target action.

SET HugeData TO $'''%'Data that is too large to transfer'%'''
Cryptography.HashText HashAlgorithm: Cryptography.HashAlgorithm.SHA256 Encoding: Cryptography.EncryptionEncoding.UTF8 TextToHash: HugeData HashedText=> HashedTexta

Operate and implement Power Automate Desktop

  1. From "Search for action", enter "Textbooks".

  2. Set the parameter as follows

    Parameter namevalue
    Hash algorithmSHA256
    EncodingUTF-8
    Hashed text%"Text to be hashed"%
  3. By execution, the result of hashed the specified text data is stored in the variable.

The exception that can occur

An error may occur at the time of the hashed.

We recommend that you implement block processing.