You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2020/06/01 13:12:03 UTC

[GitHub] [commons-codec] adamretter commented on pull request #46: Base16 Input and Output Streams

adamretter commented on pull request #46:
URL: https://github.com/apache/commons-codec/pull/46#issuecomment-636852741


   @garydgregory @aherbert I have now updated this PR to use decode/encode tables and I have gotten rid of the charset stuff. I have also removed the additional static convenience methods that were felt to be out-of-place.
   
   The Base16 stuff supports upper and lower-case hex alphabets. It follows [RFC 4648](https://tools.ietf.org/html/rfc4648) as requested. Therefore the default alphabet is upper-case as that is the only one specified in RFC 4648.
   
   It does not support padding, because RFC 4648 clearly says:
   
   > Unlike base 32 and base 64, no special padding is necessary since a full code word is always available.
   
   It also does not support line-wrapping, because RFC 4648 states:
   
   > Implementations MUST NOT add line feeds to base-encoded data unless
      the specification referring to this document explicitly directs base
      encoders to add line feeds after a specific number of characters.
   
   AFAIK there is no standard for hex encoded data that suggests line-wrapping.
   
   
   Regarding ignoring characters outside of the alphabet, RFC 6468 states:
   
   > Implementations MUST reject the encoded data if it contains
      characters outside the base alphabet when interpreting base-encoded
      data, unless the specification referring to this document explicitly
      states otherwise. 
   
   AFAIK there is no standard for hex encoded data that allows invalid characters. Therefore an IllegalArgumentException is thrown if the user tries to decode characters outside of the Base16 alphabets.
   
   
   Hopefully this now addresses your concerns?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org