BigQuery - Convert Bytes to BASE64 or HEX String

event 2021-09-18 visibility 3,967 comment 0 insights
more_vert
insights Stats
BigQuery - Convert Bytes to BASE64 or HEX String
Raymond Raymond Code Snippets & Tips

Code snippets and tips for various programming languages/frameworks. All code examples are under MIT or Apache 2.0 license unless specified otherwise. 

BigQuery provides built-in functions to convert bytes to BASE64 or HEX string.

Code snippet

SELECT TO_BASE64(MD5('ABC')) AS BASE64, TO_HEX(MD5('ABC')) AS HEX;

Results:

20210918113747-image.png

JSON result:

[{"BASE64": "kC+90rHfDE9wtKXSNSXpMg==","HEX": "902fbdd2b1df0c4f70b4a5d23525e932"}]
More from Kontext
comment Comments
No comments yet.

Please log in or register to comment.

account_circle Log in person_add Register

Log in with external accounts