This is used to auto-generate the SVG for use in ERC721 NFT Metadata standard. It uses the unofficial "image_data" field that can be seen in OpenSea.
It also adds an extra xmlns to the SVG that is NOT generated by the smart contract. Some rendering services won't render the SVG without it, but it's technically not required and thus excluded from the smart contract, but included in the metadata API.
It still ends up generates generating the same cube from the same hash.
This is deployed on Netlify Functions.