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

Hide alphabet internals #48

Merged
merged 3 commits into from
Feb 8, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/base64.ml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ let make_alphabet alphabet =

let length_alphabet { emap; _ } = Array.length emap

let alphabet { emap; _ } = emap
let alphabet { emap; _ } =
String.init (Array.length emap) (fun i -> Char.chr emap.(i))

let default_alphabet =
make_alphabet
Expand Down
2 changes: 1 addition & 1 deletion src/base64.mli
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ val make_alphabet : string -> alphabet
val length_alphabet : alphabet -> int
(** Returns length of the alphabet, should be 64. *)

val alphabet : alphabet -> int array
val alphabet : alphabet -> string
(** Returns the alphabet. *)

val decode_exn :
Expand Down