dm Damiano Mazzella

Open-source · Napoli, Italia

From microcontrollers
to native runtimes.

Header-only C++ libraries, Node.js tooling that talks straight to C, and MicroPython native modules for cryptography and hardware — all free and open-source.

C++

C++

Modern, header-only libraries. Drop a header in, no build system gymnastics.

jose

C++20 · header-only

JSON Object Signing and Encryption: JWT, JWS, JWE and JWK in a single header-only library, backed by Botan with jsoncons or nlohmann/json.

  • RFC 7515 / 7516 / 7517 / 7519
  • HS · RS · PS · ES 256/384/512
  • JWKS key sets
#include <jose/jwt/jwt_botan_jsoncons.hpp>

std::error_code ec;
std::string token = jwt::create()
    .set_issuer("VirtualDriver")
    .set_payload_claim("data", jwt::claim(std::string("hello")))
    .sign(jwt::algorithm::hs256("my-secret"), ec);

auto decoded = jwt::decode(token, ec);
jwt::verify()
    .with_issuer("VirtualDriver")
    .allow_algorithm(jwt::algorithm::hs256("my-secret"))
    .verify(decoded, ec);

dotenv

C++11 · header-only

Load environment variables from .env files. A single header with zero dependencies, working on Windows (MSVC, MinGW), Linux and macOS.

  • Multi-line values
  • $VAR / ${VAR} expansion
  • Escapes & inline comments
#include <iostream>
#include "dotenv.h"

int main() {
    // Load .env from the current directory
    dotenv::init();

    // Read with a fallback default
    std::string host = dotenv::getenv("DATABASE_HOST", "localhost");
    std::cout << "Host: " << host << std::endl;
    return 0;
}
JS

Node.js

Call native code, drive Windows COM and embed other runtimes directly from JavaScript and TypeScript.

node-ctypes

C++20 · N-API · libffi

Python ctypes for Node.js. A high-performance FFI with full ctypes compatibility: if you know Python ctypes, you already know node-ctypes.

  • Structs, unions, bit fields, arrays
  • Callbacks & async calls
  • Prebuilt for Windows · macOS · Linux
import { CDLL, Structure, c_int32, c_size_t, c_char_p } from "node-ctypes";

const libc = new CDLL(process.platform === "win32" ? "msvcrt" : null);

const strlen = libc.strlen;
strlen.argtypes = [c_char_p];
strlen.restype = c_size_t;
console.log(strlen("hello")); // 5n

class Point extends Structure {
  static _fields_ = [["x", c_int32], ["y", c_int32]];
}

@node-ctypes/python

TypeScript · ESM

Embed CPython in Node.js with a typed, async API powered by node-ctypes. Python runs in-process: no subprocess, no custom native bridge.

  • Live module proxies
  • JS modules callable from Python
  • asyncio & async iterators
import { Python } from "@node-ctypes/python";

const python = await Python.initialize({ stdout: "node", stderr: "node" });
try {
  const math = await python.import("math");
  console.log(await math.sqrt(81)); // 9

  await python.exec("def add(a, b): return a + b");
  console.log(await python.main.add(20, 22)); // 42
} finally {
  await python.finalize();
}

@node-ctypes/comtypes

TypeScript · Windows

Typed Windows COM support for Node.js powered by node-ctypes, modelled on Python comtypes. Methods run asynchronously on a dedicated COM thread, so slow objects never block the event loop.

  • Async methods, sync properties
  • IDispatch, VARIANT & SAFEARRAY
  • COM servers written in JavaScript
import { apartment, CreateObject } from "@node-ctypes/comtypes";

using _ = apartment(); // CoInitializeEx ... CoUninitialize

// Typed from the object's type library
using dict = await CreateObject("Scripting.Dictionary");
await dict.Add("a", 1); // methods return promises
console.log(dict.Count, dict.Item("a")); // properties are synchronous

using fso = await CreateObject("Scripting.FileSystemObject");
console.log(await fso.GetTempName());
µPy

MicroPython

Native C modules and pure-Python drivers for microcontrollers: cryptography, Bluetooth, video.

ucryptography

C · Mbed TLS

Lightweight port of PyCA cryptography to MicroPython. Same import paths, so the same code runs unchanged on MicroPython and CPython.

  • RSA · EC · Ed25519
  • AES-GCM/CBC · HMAC · HOTP/TOTP
  • X.509 certificates & CSRs
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import padding, rsa

message = b"A message I want to sign"
pss = padding.PSS(mgf=padding.MGF1(hashes.SHA256()), salt_length=32)

private_key = rsa.generate_private_key(public_exponent=65537, key_size=2048)
signature = private_key.sign(message, pss, hashes.SHA256())

private_key.public_key().verify(signature, message, pss, hashes.SHA256())

ucrypto

C · TomsFastMath

Fast RSA and elliptic-curve cryptography for MicroPython, focused on digital signatures. ECDSA API inspired by fastecdsa.

  • ufastrsa: sign, verify, encrypt
  • ufastecdsa: P-256 and friends
  • Arbitrary curve arithmetic
from ufastecdsa import curve, ecdsa, keys

private_key, public_key = keys.gen_keypair(curve.P256)

m = "a message to sign via ECDSA"
r, s = ecdsa.sign(m, private_key)

print(ecdsa.verify((r, s), m, public_key))  # True

anx7625

C · Portenta H7

MicroPython video primitives for the Arduino Portenta H7: drive an HDMI display through the USB-C (ANX7625) bridge, with double-buffered page flipping and LVGL support.

  • 800×600 RGB565 framebuffer
  • Double-buffered page flip
  • LVGL support
import _anx7625, framebuf, machine

i2c = machine.I2C(1, freq=400_000)
pins = machine.Pin.cpu
buf = bytearray(800 * 600 * 2 * 2)

anx = _anx7625.ANX7625(i2c, pins.K2, pins.J3, pins.J6, buf, width=800, height=600)
fb = framebuf.FrameBuffer(anx.framebuffer, anx.width, anx.height, framebuf.RGB565)
fb.text("Hello HDMI", 20, 16, 0xFFFF)
anx.flush()

uBLE

Pure Python

Lightweight Bluetooth Low Energy driver written in pure Python for MicroPython: control BLE chips from a PyBoard by speaking HCI directly.

  • HCI packet parsing
  • HCI packet building
  • No native code
from binascii import hexlify
from bluetooth_low_energy.api.scanner import Scanner

for entry in Scanner().scan(5000):
    print(hexlify(entry.address, ":"), entry.rssi, entry.get_data())