'Wrong result after sha256

My code:

var checksum = CryptoJS.SHA256('D8BABDA80C90578ED2EA2DA8644F970BF1B532147B8C1AC3343076311E8EBFFE')

Eperated result is:

5c495d2137c87ff4edbd9c8c2df9d5a887ec0ba6806eccdb3343d4068744f819

I am receiving:

8e6417b23327bec1972ae3ec6c306abb7f2cce7af0cd32f6fb3397c21908e8ce

I think it's something related to the way to encode, but I don't know how to solve it. I think the function is treating the variable as a text, but it should treat it as hex



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source