Variable bytesConversionConst

bytesConversion: {
    fromBase64(base64: string): Uint8Array;
    fromHex(hex: string): Uint8Array;
    toBase64(data: Uint8Array): string;
    toHex(data: Uint8Array): string;
} = ...

Provides utility functions for converting between Uint8Array, base64, and hex. Typically used to convert JSON strings loaded from data sources into binary vectors used as QRy-codes

Type declaration

  • fromBase64:function
    • Converts a base64 string to a Uint8Array.

      Parameters

      • base64: string

        The base64-encoded string.

      Returns Uint8Array

      A Uint8Array representation of the data.

  • fromHex:function
    • Converts a hex string to a Uint8Array.

      Parameters

      • hex: string

        The hex string to convert.

      Returns Uint8Array

      A Uint8Array representation of the data.

  • toBase64:function
    • Converts a Uint8Array to a base64 string.

      Parameters

      • data: Uint8Array

        The Uint8Array to convert.

      Returns string

      A base64-encoded string.

  • toHex:function
    • Converts a Uint8Array to a hex string.

      Parameters

      • data: Uint8Array

        The Uint8Array to convert.

      Returns string

      A hexadecimal string.