andrew on Nostr: Inspired by Bitcoin's weird endianness, wrote a reasonably fast polymorphic byte swap ...
Inspired by Bitcoin's weird endianness, wrote a reasonably fast polymorphic byte swap for PostgreSQL in C. Only took a few days of Googling 🤯 Might push to pgxn later.
Cute how bswap('{"a":123}'::json) => }321:"a"{ 😍
https://github.com/pandrewhk/pg_bswapPublished at
2022-12-29 11:06:26Event JSON
{
"id": "f9cb432d6c123de2337b22e87c4951da0369a15b8947457b813a77f707ea390c",
"pubkey": "b726de20b515705ffee951591e8f54f42f93bb8509df81a851cd5bc949ec1332",
"created_at": 1672311986,
"kind": 1,
"tags": [],
"content": "Inspired by Bitcoin's weird endianness, wrote a reasonably fast polymorphic byte swap for PostgreSQL in C. Only took a few days of Googling 🤯 Might push to pgxn later.\n\nCute how bswap('{\"a\":123}'::json) =\u003e }321:\"a\"{ 😍\n\nhttps://github.com/pandrewhk/pg_bswap",
"sig": "38b2e3968e6024df2a8e771ad01520f77fec4e30f42f241f708704f7953f242c5a4c9d02ad6a3647fe9c65b5ab63f19fec7ae79000696934712466d2e7b9aa04"
}