Base64 in TypeScript: Type-Safe Encoding with btoa and Buffer