Skip to content

Check valid encoding given an alphabet #286

@tcerqueira

Description

@tcerqueira

The problem

  • I want to check the encoding is valid without decoding

A bit follow-up to this #191 .

Given an alphabet this seems a useful feature to me. Currently, I'm doing as suggested: decoding, checking for errors and discarding the result but I'm not sure the compiler can always optimize the allocations away.

This is not complex, right? We can check for the 4 kinds of error in DecodeError without decoding.

  • Character not in alphabet
  • Invalid length
  • Invalid symbol before padding
  • Invalid padding

Asking for some feedback, I can work on it.

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