You can’t really get all the way there using standard command line tools, because we add check digits using a nonstandard Luhn algorithm. You can get 99% there though:
Difference from your attempts are openssl for the digest because we want the raw bytes and not hex, and using Python to get base32 and not base64. There is a base32 utility you can install, too.
This gets you the device ID without check digits. It doesn’t look exactly the same as what Syncthing spits out, but it’s accepted in this format by Syncthing - both in the config and the GUI.
If you really need it in the “final” format you need to use the Syncthing REST API to do the last conversion step.
It was definitively to late yesterday. Otherwise it’s not explainable that I’ve overlooked base32 in the docs.
Thanks for the quick response! Yeah, I was expecting such binary format and already experimenting with “xxd” but your inline approach with SHA256 is clearly smarter.