Is it possible to generate the SHA256 hash of javascript and styles using webpack?

I am using Webpack 5 for my React App.

We want to enforce a strict Content Security Policy.

And we need to add the SHA256 hash of the Javascript and the CSS to our HTML page for the Content Security Policy.

So far, I have not been able to figure out a way to generate SHA256 hash using webpack.