Skip to content

Instantly share code, notes, and snippets.

View genecyber's full-sized avatar
🎯
Focusing

Shannon Code genecyber

🎯
Focusing
View GitHub Profile
@genecyber
genecyber / check_telegram_signature.js
Created April 4, 2019 20:01 — forked from Pitasi/check_telegram_signature.js
Telegram website login widget, signature check sample using Node.js
// Copied by https://gist.github.com/dotcypress/8fd12d6e886cd74bba8f1aa8dbd346aa,
// thanks for improving code style
const { createHash, createHmac } = require('crypto');
const TOKEN = "ABC:12345...";
// I prefer get the secret's hash once but check the gist linked
// on line 1 if you prefer passing the bot token as a param
const secret = createHash('sha256')
.update(TOKEN)