Products · Dash API

Utils

Convert text to base64 or hex and back, without waiting for Dash.

Helpers that run in the dot itself, so they need no Dash and answer at once, without await.

dash.utils.base64

TypeScript
dash.utils.base64.encode(text: string): string
dash.utils.base64.decode(encoded: string): string

Text to base64 and back, as UTF-8: dash.utils.base64.encode("Salone") is "U2Fsb25l". decode throws for text that isn't base64.

dash.utils.hex

TypeScript
dash.utils.hex.encode(text: string): string
dash.utils.hex.decode(encoded: string): string

Text to hex and back, as UTF-8: dash.utils.hex.encode("Salone") is "53616c6f6e65". decode throws for text that isn't hex.

Keep reading