JS
const crypto = require("crypto");
const userId = "";
const appSecret = "";
const hash = crypto
.createHmac("sha256", appSecret)
.update(userId)
.digest("hex");
Python
import hmac
import hashlib
app_secret = b"<app_secret>"
user_id = b"<user_id>"
hash = hmac.new(app_secret, user_id, hashlib.sha256).hexdigest()
PHP
<?php
$appSecret = '<APP_SECRET>';
$userId = '<USER_ID>';
$hash = hash_hmac('sha256', $userId, $appSecret);