I have these code examples in Javascript:
function generateAuthHeader(dataToSign) { var hash = CryptoJS.HmacSHA256(dataToSign, environment["api-secre