And for those of you who saw my "just use this simple TOTP thing" toot earlier to @neauoire, behold, this thing we found when I got tired of unfucking another C tool: https://github.com/angt/totp
It's not for people who want their batteries included. To be useful you need to provide your own Base32 decoder. But if you're building some dmenu-based shit with a bunch of Unix pipes, or porting some C to Uxn..... this will be your shit for sure.