Add Base64Url encoding by JordanMartinez · Pull Request #56 · purescript-node/purescript-node-buffer

@JordanMartinez

Description of the change

  • Add Base64Url encoding.

Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0000)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

@JordanMartinez

@JordanMartinez

@JordanMartinez JordanMartinez changed the title update encoding Add Base64Url encoding; drop aliased encodings

Jul 5, 2023

@JordanMartinez

@thomashoneyman

Has Node indicated that they will drop these aliases? What harm do you see in retaining them?

@JordanMartinez

Has Node indicated that they will drop these aliases? What harm do you see in retaining them?

The UCS2 one not so much, but the binary one is confusing. Per Node docs

'binary': Alias for 'latin1'. See binary strings for more background on this topic. The name of this encoding can be very misleading, as all of the encodings listed here convert between strings and binary data (emphasis mine). For converting between strings and Buffers, typically 'utf8' is the right choice.

@JordanMartinez

Regardless, this is one of those "controversial" changes, and I don't want to be blocked by this. I'll revert the commit.

@JordanMartinez

@JordanMartinez JordanMartinez changed the title Add Base64Url encoding; drop aliased encodings Add Base64Url encoding

Jul 5, 2023

thomashoneyman