Skip to content

Instantly share code, notes, and snippets.

@1sudo
1sudo / stf_to_json.py
Last active October 9, 2020 20:56
Convert SWG string file to JSON
import io
import numpy as np
import json
from os import walk, path, chdir
from pathlib import Path
class STFReader:
def __init__(self):
self.buffer = None
self.value_array = {}
import json, hmac, hashlib, time, requests
from requests.auth import AuthBase
# Before implementation, set environmental variables with the names API_KEY and API_SECRET
API_KEY = ''
API_SECRET = ''
# Create custom authentication for Coinbase API
class CoinbaseWalletAuth(AuthBase):
def __init__(self, api_key, secret_key):
class STFWriter:
def __init__(self):
self.b = bytearray()
self.row_count = None
self.character_count = None
self.fname = None
def parse_bytes(self, value, num_bytes=None):