Recreating code from node crypto in expo-crypto

I want to recreate the below line of code using expo-crypto in bare react-native

const payload = new Buffer(JSON.stringify(body)).toString();
const signature = crypto.createHmac('sha256', secret).update(payload).digest('hex')