This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hmac | |
def checkValidateInitData(hash_str, init_data, token, c_str="WebAppData"): | |
""" | |
Validates the data received from the Telegram web app, using the | |
method documented here: | |
https://core.telegram.org/bots/webapps#validating-data-received-via-the-web-app | |
hash_str - the has string passed by the webapp | |
init_data - the query string passed by the webapp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"url": "https://mini-app.local:5173", | |
"name": "CryptoX", | |
"iconUrl": "https://logoipsum.com/logoipsum-avatar.png" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
npm install buffer | |
import { Buffer } from 'buffer'; | |
globalThis.Buffer = Buffer; | |
npm install -D vite-plugin-node-polyfills | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="description" content="Easily calculate SHA-512 algorithms" /> | |
<script type="text/javascript" src="assets/js/sha512.js"> | |
</script> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
<script type="text/javascript"> | |
//<![CDATA[ | |
function calcSHA() | |
{ | |
calcHash("SHA-512"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const simulateNativeLink = (rowData, e) => { | |
if (e.ctrlKey || e.metaKey || e.which === 2 || e.button === 4) { | |
const link = document.createElement('a'); | |
link.target = '_blank'; | |
link.rel = 'noopener noreferrer'; | |
link.href = `/my-orders/${rowData.id}`; | |
link.click(); | |
} else { | |
history.push(`/my-orders/${rowData.id}`); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "windows.h" | |
#include "wincrypt.h" | |
#include "stdio.h" | |
/* This code example: | |
1) creates a Crypto Service Provider | |
2) generates keys | |
3) extracts public key | |
4) exports private key into PEM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dir "." -Recurse | Unblock-File | |
Get-ChildItem "." -Recurse -Include *.dll | Unblock-File |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
html { | |
background-color: black; | |
color:darkgray; | |
overflow: hidden; | |
} | |
#logger { | |
padding-top:20px; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// https://stackoverflow.com/questions/70205816/intercept-websocket-messages | |
// | |
function listen(fn){ | |
fn = fn || console.log; | |
let property = Object.getOwnPropertyDescriptor(MessageEvent.prototype, "data"); | |
const data = property.get; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const WebSocketProxy = new Proxy(window.WebSocket, { | |
construct(target, args) { | |
console.log("Proxying WebSocket connection", ...args); | |
const ws = new target(...args); | |
// Configurable hooks | |
ws.hooks = { | |
beforeSend: () => null, | |
beforeReceive: () => null | |
}; |
NewerOlder