Skip to content

Encode/decode non-utf8 bytes #29

@voliva

Description

@voliva

I'm integrating with polkadot-vault, which uses a QR code to air-gap sign transactions.

Their protocol requires raw binary encoding - Uint8Array goes in, gets read byte-by-byte and appended. However, this library only accepts strings, and even if I create a string from that binary, currently mode: 'byte' uses new TextEncoder() which encodes each byte using UTF-8, which breaks the payload.

Would it be acceptable to add an option to provide a specific encoder/decoder?

Maybe another option would be to add a separate set of functions to encode/decode "byte" QR codes using Uint8Arrays as inputs and outputs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions