Skip to content

Instantly share code, notes, and snippets.

View edwinfinch's full-sized avatar

Edwin Finch edwinfinch

View GitHub Profile
@Pitasi
Pitasi / check_telegram_signature.js
Last active May 19, 2024 08:51
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)
<h2>reCAPTCHA without form / AJAX only</h2>
<div class="panel panel-warning" id="panel-recaptcha">
<div class="panel-heading">
<h3 class="panel-title">Captcha</h3>
</div>
<div class="panel-body">
<div id="recaptcha-service" class="g-recaptcha"
data-callback="recaptchaCallback"
data-sitekey=""></div>