Skip to content

Instantly share code, notes, and snippets.

/**
* PromptPay QR Code Encoder and Decoder
*
* This module provides functions to encode and decode PromptPay QR codes.
* PromptPay is Thailand's payment system that allows money transfers using mobile numbers,
* national IDs, e-wallet IDs, or bank accounts.
*/
/**
* Enum for PromptPay proxy types
var raw json.RawMessage
var tx types.Transaction
raw = []byte("{\"blockHash\":\"0x23613f63c7ca19e65f66b4e4310fcccc53266aa4f310016af48ce81c7c4e430a\",\"blockNumber\":\"0x48f5dac\",\"from\":\"0x00000000000000000000000000000000000a4b05\",\"gas\":\"0x0\",\"gasPrice\":\"0x0\",\"hash\":\"0x54776d636862587eb643f76c01a1e236a43395150e143fa24c6b130a0f84d267\",\"input\":\"0x6bf6a42d0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000102e2cf00000000000000000000000000000000000000000000000000000000048f5dac0000000000000000000000000000000000000000000000000^C8c003f5913365cb2\"}")
err := json.Unmarshal(raw, &tx)
if err != nil {
logrus.Error(err)
}
#include<bits/stdc++.h>
using namespace std;
const long long base=31,mod=1000000003;
long long hashP[1000006],hashC,POW[1000006],lenP,lenC;
string strC,strP;
long long gethash(int l,int r){
if (l==1){
return hashP[r];
}
return (hashP[r]-hashP[l-1]*POW[r-l+1]+mod*mod)%mod;
#include<bits/stdc++.h>
using namespace std;
const long long base=31,mod=1000000003;
long long hashP[1000006],hashC,POW[1000006],lenP,lenC;
string strC,strP;
long long gethash(int l,int r){
if (l==1){
return hashP[r];
}
return (hashP[r]-hashP[l-1]*POW[r-l+1]+mod*mod)%mod;