05nelsonm / encoding

A Kotlin Multiplatform library for configurable, streamable, efficient and extensible Encoding/Decoding with support for base16/32/64.
Apache License 2.0
33 stars 5 forks source link

Add ability to not finalize output when `flush` is called #119

Closed 05nelsonm closed 1 year ago

05nelsonm commented 1 year ago

For Base32 Crockford, the current operative experience is to append the check symbol (if declared in the config) and reset the hyphenInterval counter whenever doFinalProtected is invoked. This could occur when someone invokes flush, such that the output would then be something like 91JP-RV3F-41*BPYW-KCCG-GG*.

By adding to the config a setting to only apply the check byte and reset the hyphen counter when doFinal is invoked, the final output of the combined input would then be (if desired) 91JP-RV3F-41BP-YWKC-CGGG-*