All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Login


All New Login

All gists matching topic python

Recently created
Least recently created
Recently updated
Least recently updated
nukdokplex's Avatar

nukdokplex / Telegram Python Webapp Validator

0 likes
0 forks
1 files
Last active 1755833310
Validates init data from webapp to check if a method was received from Telegram
python telegram
1 from hmac import new as hmac_new
2 from hashlib import sha256
3 from urllib.parse import unquote
4
5
6 def validate(init_data: str, token: str, c_str="WebAppData") -> None | dict[str, str]:
7 """Validates init data from webapp to check if a method was received from Telegram
8 Args:
9 init_data (str): init_data string received from webapp
10 token (str): token of bot that initiated webapp
Newer Older

Powered by Opengist ⋅ Load: 22ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文
⋅ NukDokPlex ⋅ GitHub ⋅ Telegram