Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make default base64 config ignore newline (and maybe also leading/trailing whitespaces) characters #26

Open
haochenx opened this issue Feb 9, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@haochenx
Copy link
Member

haochenx commented Feb 9, 2023

方針

Default config について

https://github.com/kxcteam/kxclib-ocaml/blob/ce6cf01df256cff329b28e52b8dc2a9eb8e72cb9/kxclib.ml#L2730
の代りに、

module Config_rfc4648_relaxed = struct
  include Config_rfc4648
  let ignore_newline = true
end

を用意して、代りにこちらを include Make(Config_rfc4648_relaxed) しましょう

newline/whitespace config について

現在の ignore_newline https://github.com/kxcteam/kxclib-ocaml/blob/ce6cf01df256cff329b28e52b8dc2a9eb8e72cb9/kxclib.ml#L2496-L2497 のかわりに、

(** white spaces : SP, LF, CR, HT, VT, FF;
     line breaks : LF, CR;

    NB that if [ignore_unknown] is set to true, then all white space characters are
    automatically ignored *)
val ignore_whitespace : [
  | `newlines_only (** only ignore LF and/or CR and white spaces immediately following *)
  | `all_white_spaces (** ignore all white spaces *)
] option;
@kxc-ryfujis
Copy link
Contributor

how about adding ignore_whitespaces config?

note: https://v2.ocaml.org/api/String.html#VALtrim

Whitespace characters are: ' ', '\x0C' (form feed), '\n', '\r', and '\t'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants