Generate SHA256 hash for API-token

You can use the plugin ToolBox. It’s got a workflow action called ‘Server script’, with which you can use Node.js’s built-in modules ‘crypto’ and ‘buffers’:

var crypto = require('crypto')
                  , text = 'I love cupcakes'
                  , key = 'abcdeghi'
                  , hash;

var hash = crypto.createHmac('sha256', key).update(text).digest('hex');

var base64 = Buffer.from(hash).toString('base64');
4 Likes