Forum Discussion

CountMcCracker's avatar
CountMcCracker
Frequent Visitor
9 months ago
Solved

Hash SHA256 in Dataflows Gen2

Is it possible to create a hash key using the SHA256 algorithm in dataflows gen2? The function I am invoking is returning an error. Is there an issue with the function or is SHA256 not supported?

 

Here is the function: 

 

let
    Hash = (input as text) as text =>
        let
            // Convert text to binary
            inputBinary = Text.ToBinary(input, TextEncoding.Utf8),

            // Compute SHA-256 hash
            sha256Binary = Binary.Hash(inputBinary, HashAlgorithm.SHA256),

            // Convert hash to hex string (64 characters)
            Hex = Binary.ToText(sha256Binary, BinaryEncoding.Hex)
        in
            Hex
in
    Hash

4 Replies