From 01e4f66a5c1fbbc0cdb54e6a4de044067cd16ad8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Aur=C3=A9lio=20da=20Silva?= Date: Mon, 8 Nov 2021 02:23:13 -0300 Subject: [PATCH 1/8] chore: updating ppx bisect flags for newer versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Aurélio da Silva --- lib/dune | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dune b/lib/dune index 7b582d7..fb768ba 100644 --- a/lib/dune +++ b/lib/dune @@ -3,6 +3,6 @@ (public_name twostep) (synopsis "HOTP and TOTP algorithms for 2-step verification (for OCaml)") (preprocess - (pps bisect_ppx -- -conditional)) + (pps bisect_ppx)) (libraries base hex mirage-crypto mirage-crypto-pk mirage-crypto-rng mirage-crypto-rng.unix bisect_ppx)) From 1bb6860f0603b1eccec1c124c72a641f61891b94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Aur=C3=A9lio=20da=20Silva?= Date: Sat, 26 Mar 2022 21:55:22 -0300 Subject: [PATCH 2/8] chore: :gear: updating coverage config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Aurélio da Silva --- Makefile | 30 ++++++++------ docs/apicov/coverage.css | 10 ++--- docs/apicov/lib/base32.ml.html | 72 ++++++++++++++++----------------- docs/apicov/lib/helpers.ml.html | 6 +-- docs/apicov/lib/twostep.ml.html | 8 ++-- dune-project | 4 +- lib/dune | 4 +- test/rfc4226_samples.ml | 2 +- test/rfc6238_errata_samples.ml | 2 +- twostep.opam | 4 +- 10 files changed, 72 insertions(+), 70 deletions(-) diff --git a/Makefile b/Makefile index 4194f3d..124e1e0 100644 --- a/Makefile +++ b/Makefile @@ -92,19 +92,23 @@ coverage: clean @ mkdir -p docs/ @ rm -rf docs/apicov/ @ mkdir -p docs/apicov/ - @ BISECT_ENABLE=yes make build - @ BISECT_ENABLE=yes make test - @ bisect-ppx-report \ - -title twostep \ - -I _build/default/ \ - -tab-size 2 \ - -html coverage/ \ - `find . -name 'bisect*.out'` - @ bisect-ppx-report \ - -I _build/default/ \ - -text - \ - `find . -name 'bisect*.out'` - @ mv ./coverage/* ./docs/apicov/ +# @ BISECT_ENABLE=yes make build +# @ BISECT_ENABLE=yes make test + @ find . -name '*.coverage' | xargs rm -f + @ dune runtest --instrument-with bisect_ppx --force +# @ bisect-ppx-report \ +# -title twostep \ +# -I _build/default/ \ +# -tab-size 2 \ +# -html coverage/ \ +# `find . -name 'bisect*.out'` +# @ bisect-ppx-report \ +# -I _build/default/ \ +# -text - \ +# `find . -name 'bisect*.out'` + @ bisect-ppx-report html --title twostep + @ mv ./_coverage/* ./docs/apicov/ + @ bisect-ppx-report summary report: coverage @ bisect-ppx-report send-to Coveralls diff --git a/docs/apicov/coverage.css b/docs/apicov/coverage.css index 1741ae4..fe80c11 100644 --- a/docs/apicov/coverage.css +++ b/docs/apicov/coverage.css @@ -14,7 +14,7 @@ --visited-color: #eaffea; --visited-number-color: rgba(64, 192, 64, 0.2); --unvisited-color: #ffecec; - --unvisited-number-color: rgba(255, 128, 128, 0.3); + --unvisited-number-color: rgba(255, 128, 128, 0.5); --somevisited-color: #ffd; --highlight-color: #a0fbff; --line-number-color: rgba(0, 0, 0, 0.4); @@ -47,7 +47,7 @@ --visited-color: #002800; --visited-number-color: #252; --unvisited-color: #380000; - --unvisited-number-color: #622; + --unvisited-number-color: #822; --somevisited-color: #303000; --highlight-color: #303e3f; --line-number-color: rgba(230, 230, 230, 0.3); @@ -81,7 +81,7 @@ --visited-color: #002800; --visited-number-color: #252; --unvisited-color: #380000; - --unvisited-number-color: #622; + --unvisited-number-color: #822; --somevisited-color: #303000; --highlight-color: #303e3f; --line-number-color: rgba(230, 230, 230, 0.3); @@ -109,7 +109,7 @@ body { pre { margin: 0; - font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; + font-family: "Fira Code", "Cascadia Code", Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 13px; color: var(--code-color); cursor: text; @@ -354,12 +354,10 @@ a[id]:target + .some-visited { } code span[data-count] { - display: inline-block; background-color: var(--visited-number-color); } code span[data-count="0"] { - display: inline-block; background-color: var(--unvisited-number-color); } diff --git a/docs/apicov/lib/base32.ml.html b/docs/apicov/lib/base32.ml.html index c326ff1..8c0ccf3 100644 --- a/docs/apicov/lib/base32.ml.html +++ b/docs/apicov/lib/base32.ml.html @@ -439,88 +439,88 @@

100.00%

let reverse_base32_alphabet = function - | 'a' -> + | 'a' -> 0 - | 'b' -> + | 'b' -> 1 - | 'c' -> + | 'c' -> 2 - | 'd' -> + | 'd' -> 3 - | 'e' -> + | 'e' -> 4 - | 'f' -> + | 'f' -> 5 - | 'g' -> + | 'g' -> 6 - | 'h' -> + | 'h' -> 7 - | 'i' -> + | 'i' -> 8 - | 'j' -> + | 'j' -> 9 - | 'k' -> + | 'k' -> 10 - | 'l' -> + | 'l' -> 11 | 'm' -> 12 - | 'n' -> + | 'n' -> 13 - | 'o' -> + | 'o' -> 14 - | 'p' -> + | 'p' -> 15 - | 'q' -> + | 'q' -> 16 - | 'r' -> + | 'r' -> 17 - | 's' -> + | 's' -> 18 - | 't' -> + | 't' -> 19 - | 'u' -> + | 'u' -> 20 | 'v' -> 21 - | 'w' -> + | 'w' -> 22 - | 'x' -> + | 'x' -> 23 - | 'y' -> + | 'y' -> 24 - | 'z' -> + | 'z' -> 25 - | '2' -> + | '2' -> 26 - | '3' -> + | '3' -> 27 - | '4' -> + | '4' -> 28 - | '5' -> + | '5' -> 29 - | '6' -> + | '6' -> 30 - | '7' -> + | '7' -> 31 | wat -> failwith ("Invalid base32 character: " ^ Base.String.of_char wat) let rec enc_loop data ~basis ~alphabet number = - if number <= 0 - then data + if number <= 0 + then data else - let remainder = number mod basis in + let remainder = number mod basis in let result = number / basis in let digit = List.nth alphabet remainder in - enc_loop (digit ^ data) ~basis ~alphabet result + enc_loop (digit ^ data) ~basis ~alphabet result let int_to_base_x ~basis ~alphabet number = if number < basis - then List.nth alphabet number - else enc_loop "" ~basis ~alphabet number + then List.nth alphabet number + else enc_loop "" ~basis ~alphabet number let base32_to_string ?(size = 10) base32 = diff --git a/docs/apicov/lib/helpers.ml.html b/docs/apicov/lib/helpers.ml.html index 6e9953e..316e0a7 100644 --- a/docs/apicov/lib/helpers.ml.html +++ b/docs/apicov/lib/helpers.ml.html @@ -88,10 +88,10 @@

100.00%

let length = String.length msg in let remainder = length mod basis in if remainder = 0 - then msg + then msg else - let zerofill = String.make (basis - remainder) byte in - match direction with OnRight -> msg ^ zerofill | OnLeft -> zerofill ^ msg + let zerofill = String.make (basis - remainder) byte in + match direction with OnRight -> msg ^ zerofill | OnLeft -> zerofill ^ msg diff --git a/docs/apicov/lib/twostep.ml.html b/docs/apicov/lib/twostep.ml.html index 01fb1e3..87dd917 100644 --- a/docs/apicov/lib/twostep.ml.html +++ b/docs/apicov/lib/twostep.ml.html @@ -376,7 +376,7 @@

100.00%

let code ?(window = 30) ?(drift = 0) ?(digits = 6) ?(hash = "SHA-1") ~secret () = - assert (digits = 6 || digits = 8) ; + assert (digits = 6 || digits = 8) ; let decoded = Base32.base32_to_string secret in let counter = Time.counter ~timestep:window ~drift () in let image = Hmac.hmac ~hash ~secret:decoded counter in @@ -429,7 +429,7 @@

100.00%

let codes ?(digits = 6) ?(hash = "SHA-1") ?(amount = 1) ~counter ~secret () = - assert (amount >= 1) ; + assert (amount >= 1) ; let step index = code ~digits ~hash ~counter:(counter + index) ~secret () in Base.List.init amount ~f:step @@ -442,8 +442,8 @@

100.00%

~secret ~codes:numbers () = - assert (ahead >= 0) ; - assert (Base.List.length numbers >= 1) ; + assert (ahead >= 0) ; + assert (Base.List.length numbers >= 1) ; let amount = Base.List.length numbers in let step index = let valid = diff --git a/dune-project b/dune-project index 1505a50..a064612 100644 --- a/dune-project +++ b/dune-project @@ -1,4 +1,4 @@ -(lang dune 1.7) +(lang dune 2.7) (name twostep) (version 1.0.0) -(using fmt 1.1) +(formatting (enabled_for dune ocaml)) diff --git a/lib/dune b/lib/dune index fb768ba..69421b7 100644 --- a/lib/dune +++ b/lib/dune @@ -2,7 +2,7 @@ (name twostep) (public_name twostep) (synopsis "HOTP and TOTP algorithms for 2-step verification (for OCaml)") - (preprocess - (pps bisect_ppx)) + (instrumentation + (backend bisect_ppx)) (libraries base hex mirage-crypto mirage-crypto-pk mirage-crypto-rng mirage-crypto-rng.unix bisect_ppx)) diff --git a/test/rfc4226_samples.ml b/test/rfc4226_samples.ml index 4efb33d..674d900 100644 --- a/test/rfc4226_samples.ml +++ b/test/rfc4226_samples.ml @@ -39,7 +39,7 @@ let _ = let secret = get_secret algorithm in let image = I.hmac ~hash:algorithm ~secret payload_counter in let code = I.truncate ~image ~digits:6 in - print_endline (padded_counter ^ " | " ^ code))) ; + print_endline (padded_counter ^ " | " ^ code) ) ) ; print_endline "----------" ; print_endline ( "? | " diff --git a/test/rfc6238_errata_samples.ml b/test/rfc6238_errata_samples.ml index b345adb..9725340 100644 --- a/test/rfc6238_errata_samples.ml +++ b/test/rfc6238_errata_samples.ml @@ -70,4 +70,4 @@ let _ = ^ " | " ^ code ^ " | " - ^ algorithm ))) + ^ algorithm ) ) ) diff --git a/twostep.opam b/twostep.opam index 7314de5..58696d7 100644 --- a/twostep.opam +++ b/twostep.opam @@ -31,8 +31,8 @@ depends: [ "mirage-crypto" {>= "0.6.1"} "mirage-crypto-rng" {>= "0.6.1"} "mirage-crypto-pk" {>= "0.6.1"} - "dune" {build & >= "1.7.0"} - "bisect_ppx" {dev & >= "2.0.0"} + "dune" {>= "2.7.0"} + "bisect_ppx" {dev & >= "2.5.0"} "alcotest" {with-test & >= "0.8.4"} "ocamlformat" {with-test & >= "0.15.0"} ] From cc8ead3d445123f1e4f082433511d7f9b942c8b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Aur=C3=A9lio=20da=20Silva?= Date: Sat, 26 Mar 2022 22:09:09 -0300 Subject: [PATCH 3/8] chore: :gear: updating github workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Aurélio da Silva --- .github/workflows/coverage-report.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/coverage-report.yml b/.github/workflows/coverage-report.yml index 33ecb46..8a567b1 100644 --- a/.github/workflows/coverage-report.yml +++ b/.github/workflows/coverage-report.yml @@ -24,13 +24,10 @@ jobs: - run: opam pin add twostep.dev . --no-action - run: opam depext twostep --yes --with-test - run: opam install . --deps-only --with-doc --with-test - - run: opam exec -- dune build - env: - BISECT_ENABLE: yes - - run: opam exec -- dune runtest - env: - BISECT_ENABLE: yes - - run: opam exec -- bisect-ppx-report -I _build/default/ -text - `find . -name 'bisect*.out'` + - run: find . -name '*.coverage' | xargs rm -f + - run: opam exec -- dune runtest --instrument-with bisect_ppx --force + - run: opam exec -- bisect-ppx-report html --title twostep + - run: opam exec -- bisect-ppx-report summary - run: opam exec -- bisect-ppx-report send-to Coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b5e26ebfae132a941378a1cad5ced1908c20c773 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Aur=C3=A9lio=20da=20Silva?= Date: Sat, 26 Mar 2022 23:16:55 -0300 Subject: [PATCH 4/8] chore: :gear: adding more OCaml versions on test/CI workflows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Aurélio da Silva --- .github/workflows/macos-ci.yml | 6 ++++-- .github/workflows/ubuntu-ci.yml | 6 ++++-- .github/workflows/windows-ci.yml | 6 ++++-- Makefile | 12 ------------ 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml index 4af4a01..74b5adf 100644 --- a/.github/workflows/macos-ci.yml +++ b/.github/workflows/macos-ci.yml @@ -25,8 +25,10 @@ jobs: - 4.08.0 - 4.08.1 - 4.09.1 - - 4.10.1 - - 4.11.0 + - 4.10.2 + - 4.11.2 + - 4.12.1 + - 4.13.1 runs-on: ${{ matrix.os }} diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index 7162bdb..bda6b34 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -25,8 +25,10 @@ jobs: - 4.08.0 - 4.08.1 - 4.09.1 - - 4.10.1 - - 4.11.0 + - 4.10.2 + - 4.11.2 + - 4.12.1 + - 4.13.1 runs-on: ${{ matrix.os }} diff --git a/.github/workflows/windows-ci.yml b/.github/workflows/windows-ci.yml index 1ceb6d6..f4f3795 100644 --- a/.github/workflows/windows-ci.yml +++ b/.github/workflows/windows-ci.yml @@ -25,8 +25,10 @@ jobs: - 4.08.0 - 4.08.1 - 4.09.1 - - 4.10.1 - - 4.11.0 + - 4.10.2 + - 4.11.2 + - 4.12.1 + - 4.13.1 runs-on: ${{ matrix.os }} diff --git a/Makefile b/Makefile index 124e1e0..8e49b79 100644 --- a/Makefile +++ b/Makefile @@ -92,20 +92,8 @@ coverage: clean @ mkdir -p docs/ @ rm -rf docs/apicov/ @ mkdir -p docs/apicov/ -# @ BISECT_ENABLE=yes make build -# @ BISECT_ENABLE=yes make test @ find . -name '*.coverage' | xargs rm -f @ dune runtest --instrument-with bisect_ppx --force -# @ bisect-ppx-report \ -# -title twostep \ -# -I _build/default/ \ -# -tab-size 2 \ -# -html coverage/ \ -# `find . -name 'bisect*.out'` -# @ bisect-ppx-report \ -# -I _build/default/ \ -# -text - \ -# `find . -name 'bisect*.out'` @ bisect-ppx-report html --title twostep @ mv ./_coverage/* ./docs/apicov/ @ bisect-ppx-report summary From 8e6494351fff006be3ea8841cfa4739c164c5902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Aur=C3=A9lio=20da=20Silva?= Date: Sat, 26 Mar 2022 23:50:23 -0300 Subject: [PATCH 5/8] bump: :arrow_up: updating library/package version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Aurélio da Silva --- VERSION | 2 +- docs/apiref/index.html | 4 ++-- docs/apiref/twostep/Twostep/index.html | 2 +- dune-project | 2 +- lib/twostep.mli | 2 +- twostep.opam | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/VERSION b/VERSION index 3eefcb9..7dea76e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 +1.0.1 diff --git a/docs/apiref/index.html b/docs/apiref/index.html index d387df6..6fe9e86 100644 --- a/docs/apiref/index.html +++ b/docs/apiref/index.html @@ -11,9 +11,9 @@

OCaml package documentation

    -
  1. twostep 1.0.0
  2. +
  3. twostep 1.0.1
- \ No newline at end of file + diff --git a/docs/apiref/twostep/Twostep/index.html b/docs/apiref/twostep/Twostep/index.html index e1aed2e..6ef165f 100644 --- a/docs/apiref/twostep/Twostep/index.html +++ b/docs/apiref/twostep/Twostep/index.html @@ -1,2 +1,2 @@ -Twostep (twostep.Twostep)

Module Twostep

HOTP and TOTP algorithms for 2-step verification (for OCaml).

author
Marco Aurélio da Silva
version
1.0.0
module TOTP : sig ... end

Module for TOTP algorithm.

module HOTP : sig ... end

Module for HOTP algorithm.

module Internals : sig ... end

DON'T USE THAT MODULE, PRONE TO BREAKING CHANGES AND LIKELY UNSAFE/UNSECURE!

\ No newline at end of file +Twostep (twostep.Twostep)

Module Twostep

HOTP and TOTP algorithms for 2-step verification (for OCaml).

author
Marco Aurélio da Silva
version
1.0.1
module TOTP : sig ... end

Module for TOTP algorithm.

module HOTP : sig ... end

Module for HOTP algorithm.

module Internals : sig ... end

DON'T USE THAT MODULE, PRONE TO BREAKING CHANGES AND LIKELY UNSAFE/UNSECURE!

diff --git a/dune-project b/dune-project index a064612..f439150 100644 --- a/dune-project +++ b/dune-project @@ -1,4 +1,4 @@ (lang dune 2.7) (name twostep) -(version 1.0.0) +(version 1.0.1) (formatting (enabled_for dune ocaml)) diff --git a/lib/twostep.mli b/lib/twostep.mli index f48a2b5..3c91dca 100644 --- a/lib/twostep.mli +++ b/lib/twostep.mli @@ -1,6 +1,6 @@ (** HOTP and TOTP algorithms for 2-step verification (for OCaml). @author Marco Aurélio da Silva - @version 1.0.0 + @version 1.0.1 *) (** diff --git a/twostep.opam b/twostep.opam index 58696d7..368374c 100644 --- a/twostep.opam +++ b/twostep.opam @@ -1,6 +1,6 @@ opam-version: "2.0" name: "twostep" -version: "1.0.0" +version: "1.0.1" synopsis: "HOTP and TOTP algorithms for 2-step verification (for OCaml)" description: """ This project implements algorithms for 2-step verification, being the From 7e3b2ce8d1bb7288900a1efdb17ea707efb46d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Aur=C3=A9lio=20da=20Silva?= Date: Sat, 26 Mar 2022 23:52:39 -0300 Subject: [PATCH 6/8] docs: :book: updating documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marco Aurélio da Silva --- docs/apicov/lib/base32.ml.html | 74 +-- docs/apicov/lib/helpers.ml.html | 6 +- docs/apiref/index.html | 2 +- docs/apiref/odoc.css | 449 +++++++++--------- docs/apiref/twostep/Twostep/HOTP/index.html | 17 +- .../twostep/Twostep/Internals/index.html | 7 +- docs/apiref/twostep/Twostep/TOTP/index.html | 16 +- docs/apiref/twostep/Twostep/index.html | 2 +- .../Twostep__/Base32/$Open__0_-1/index.html | 2 - .../twostep/Twostep__/Base32/index.html | 2 - .../Twostep__/Helpers/$Open__0_-1/index.html | 2 - .../twostep/Twostep__/Helpers/index.html | 2 - .../Twostep__/Hmac/$Open__0_-1/index.html | 2 - docs/apiref/twostep/Twostep__/Hmac/index.html | 2 - .../Twostep__/Secret/$Open__0_-1/index.html | 2 - .../twostep/Twostep__/Secret/index.html | 2 - .../Twostep__/Time/$Open__0_-1/index.html | 2 - docs/apiref/twostep/Twostep__/Time/index.html | 2 - docs/apiref/twostep/Twostep__/index.html | 2 +- .../Twostep__Base32/$Open__0_-1/index.html | 2 - .../apiref/twostep/Twostep__Base32/index.html | 2 +- .../Twostep__Helpers/$Open__0_-1/index.html | 2 - .../twostep/Twostep__Helpers/index.html | 2 +- .../Twostep__Hmac/$Open__0_-1/index.html | 2 - docs/apiref/twostep/Twostep__Hmac/index.html | 2 +- .../Twostep__Secret/$Open__0_-1/index.html | 2 - .../apiref/twostep/Twostep__Secret/index.html | 2 +- .../Twostep__Time/$Open__0_-1/index.html | 2 - docs/apiref/twostep/Twostep__Time/index.html | 2 +- docs/apiref/twostep/index.html | 2 +- 30 files changed, 320 insertions(+), 297 deletions(-) delete mode 100644 docs/apiref/twostep/Twostep__/Base32/$Open__0_-1/index.html delete mode 100644 docs/apiref/twostep/Twostep__/Base32/index.html delete mode 100644 docs/apiref/twostep/Twostep__/Helpers/$Open__0_-1/index.html delete mode 100644 docs/apiref/twostep/Twostep__/Helpers/index.html delete mode 100644 docs/apiref/twostep/Twostep__/Hmac/$Open__0_-1/index.html delete mode 100644 docs/apiref/twostep/Twostep__/Hmac/index.html delete mode 100644 docs/apiref/twostep/Twostep__/Secret/$Open__0_-1/index.html delete mode 100644 docs/apiref/twostep/Twostep__/Secret/index.html delete mode 100644 docs/apiref/twostep/Twostep__/Time/$Open__0_-1/index.html delete mode 100644 docs/apiref/twostep/Twostep__/Time/index.html delete mode 100644 docs/apiref/twostep/Twostep__Base32/$Open__0_-1/index.html delete mode 100644 docs/apiref/twostep/Twostep__Helpers/$Open__0_-1/index.html delete mode 100644 docs/apiref/twostep/Twostep__Hmac/$Open__0_-1/index.html delete mode 100644 docs/apiref/twostep/Twostep__Secret/$Open__0_-1/index.html delete mode 100644 docs/apiref/twostep/Twostep__Time/$Open__0_-1/index.html diff --git a/docs/apicov/lib/base32.ml.html b/docs/apicov/lib/base32.ml.html index 8c0ccf3..4388273 100644 --- a/docs/apicov/lib/base32.ml.html +++ b/docs/apicov/lib/base32.ml.html @@ -441,86 +441,86 @@

100.00%

let reverse_base32_alphabet = function | 'a' -> 0 - | 'b' -> + | 'b' -> 1 - | 'c' -> + | 'c' -> 2 - | 'd' -> + | 'd' -> 3 - | 'e' -> + | 'e' -> 4 - | 'f' -> + | 'f' -> 5 - | 'g' -> + | 'g' -> 6 - | 'h' -> + | 'h' -> 7 - | 'i' -> + | 'i' -> 8 - | 'j' -> + | 'j' -> 9 - | 'k' -> + | 'k' -> 10 - | 'l' -> + | 'l' -> 11 - | 'm' -> + | 'm' -> 12 - | 'n' -> + | 'n' -> 13 - | 'o' -> + | 'o' -> 14 - | 'p' -> + | 'p' -> 15 - | 'q' -> + | 'q' -> 16 - | 'r' -> + | 'r' -> 17 - | 's' -> + | 's' -> 18 - | 't' -> + | 't' -> 19 - | 'u' -> + | 'u' -> 20 - | 'v' -> + | 'v' -> 21 - | 'w' -> + | 'w' -> 22 - | 'x' -> + | 'x' -> 23 - | 'y' -> + | 'y' -> 24 - | 'z' -> + | 'z' -> 25 - | '2' -> + | '2' -> 26 - | '3' -> + | '3' -> 27 - | '4' -> + | '4' -> 28 - | '5' -> + | '5' -> 29 - | '6' -> + | '6' -> 30 - | '7' -> + | '7' -> 31 | wat -> failwith ("Invalid base32 character: " ^ Base.String.of_char wat) let rec enc_loop data ~basis ~alphabet number = - if number <= 0 - then data + if number <= 0 + then data else - let remainder = number mod basis in + let remainder = number mod basis in let result = number / basis in let digit = List.nth alphabet remainder in - enc_loop (digit ^ data) ~basis ~alphabet result + enc_loop (digit ^ data) ~basis ~alphabet result let int_to_base_x ~basis ~alphabet number = if number < basis - then List.nth alphabet number - else enc_loop "" ~basis ~alphabet number + then List.nth alphabet number + else enc_loop "" ~basis ~alphabet number let base32_to_string ?(size = 10) base32 = diff --git a/docs/apicov/lib/helpers.ml.html b/docs/apicov/lib/helpers.ml.html index 316e0a7..a2e900a 100644 --- a/docs/apicov/lib/helpers.ml.html +++ b/docs/apicov/lib/helpers.ml.html @@ -88,10 +88,10 @@

100.00%

let length = String.length msg in let remainder = length mod basis in if remainder = 0 - then msg + then msg else - let zerofill = String.make (basis - remainder) byte in - match direction with OnRight -> msg ^ zerofill | OnLeft -> zerofill ^ msg + let zerofill = String.make (basis - remainder) byte in + match direction with OnRight -> msg ^ zerofill | OnLeft -> zerofill ^ msg diff --git a/docs/apiref/index.html b/docs/apiref/index.html index 6fe9e86..76a6aa6 100644 --- a/docs/apiref/index.html +++ b/docs/apiref/index.html @@ -16,4 +16,4 @@

OCaml package documentation

- + \ No newline at end of file diff --git a/docs/apiref/odoc.css b/docs/apiref/odoc.css index b099c0b..5362774 100644 --- a/docs/apiref/odoc.css +++ b/docs/apiref/odoc.css @@ -1,27 +1,134 @@ @charset "UTF-8"; /* Copyright (c) 2016 The odoc contributors. All rights reserved. Distributed under the ISC license, see terms at the end of the file. - odoc 1.5.1 */ + odoc 2.1.0 */ /* Fonts */ @import url('https://fonts.googleapis.com/css?family=Fira+Mono:400,500'); @import url('https://fonts.googleapis.com/css?family=Noticia+Text:400,400i,700'); @import url('https://fonts.googleapis.com/css?family=Fira+Sans:400,400i,500,500i,600,600i,700,700i'); +:root, +.light:root { + --main-background: #FFFFFF; + + --color: #333333; + --link-color: #2C94BD; + --anchor-hover: #555; + --anchor-color: #d5d5d5; + --xref-shadow: #cc6666; + --header-shadow: #ddd; + --by-name-version-color: #aaa; + --by-name-nav-link-color: #222; + --target-background: rgba(187, 239, 253, 0.3); + --target-shadow: rgba(187, 239, 253, 0.8); + --pre-border-color: #eee; + --code-background: #f6f8fa; + + --li-code-background: #f6f8fa; + --li-code-color: #0d2b3e; + --toc-color: #1F2D3D; + --toc-before-color: #777; + --toc-background: #f6f8fa; + --toc-list-border: #ccc; + + --spec-summary-border-color: #5c9cf5; + --spec-summary-background: var(--code-background); + --spec-summary-hover-background: #ebeff2; + --spec-details-after-background: rgba(0, 4, 15, 0.05); + --spec-details-after-shadow: rgba(204, 204, 204, 0.53); +} + +.dark:root { + --main-background: #202020; + --code-background: #222; + --line-numbers-background: rgba(0, 0, 0, 0.125); + --navbar-background: #202020; + + --color: #bebebe; + --dirname-color: #666; + --underline-color: #444; + --visited-color: #002800; + --visited-number-color: #252; + --unvisited-color: #380000; + --unvisited-number-color: #622; + --somevisited-color: #303000; + --highlight-color: #303e3f; + --line-number-color: rgba(230, 230, 230, 0.3); + --unvisited-margin-color: #622; + --border: #333; + --navbar-border: #333; + --code-color: #ccc; + + --li-code-background: #373737; + --li-code-color: #999; + --toc-color: #777; + --toc-background: #252525; + + --hljs-link: #999; + --hljs-keyword: #cda869; + --hljs-regexp: #f9ee98; + --hljs-title: #dcdcaa; + --hljs-type: #ac885b; + --hljs-meta: #82aaff; + --hljs-variable: #cf6a4c; +} + +@media (prefers-color-scheme: dark) { + :root { + --main-background: #202020; + --code-background: #333; + --line-numbers-background: rgba(0, 0, 0, 0.125); + --navbar-background: #202020; + + --meter-unvisited-color: #622; + --meter-visited-color: #252; + --meter-separator-color: black; + + --color: #bebebe; + --dirname-color: #666; + --underline-color: #444; + --visited-color: #002800; + --visited-number-color: #252; + --unvisited-color: #380000; + --unvisited-number-color: #622; + --somevisited-color: #303000; + --highlight-color: #303e3f; + --line-number-color: rgba(230, 230, 230, 0.3); + --unvisited-margin-color: #622; + --border: #333; + --navbar-border: #333; + --code-color: #ccc; + --by-name-nav-link-color: var(--color); + + --li-code-background: #373737; + --li-code-color: #999; + --toc-color: #777; + --toc-before-color: #777; + --toc-background: #252525; + --toc-list-border: #ccc; + --spec-summary-hover-background: #ebeff2; + --spec-details-after-background: rgba(0, 4, 15, 0.05); + --spec-details-after-shadow: rgba(204, 204, 204, 0.53); + + --hljs-link: #999; + --hljs-keyword: #cda869; + --hljs-regexp: #f9ee98; + --hljs-title: #dcdcaa; + --hljs-type: #ac885b; + --hljs-meta: #82aaff; + --hljs-variable: #cf6a4c; + } +} /* Reset a few things. */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { - margin: 0; padding: 0; border: 0; - font-size: inherit; font: inherit; - line-height: inherit; vertical-align: baseline; - text-align: inherit; - color: inherit; - background: transparent; + } table { @@ -38,14 +145,14 @@ html { } body { - font-family: "Fira Sans", Helvetica, Arial, sans-serif; text-align: left; - color: #333; background: #FFFFFF; + color: var(--color); + background-color: var(--main-background); } -.content { - max-width: 90ex; +body { + max-width: 100ex; margin-left: calc(10vw + 20ex); margin-right: 4ex; margin-top: 20px; @@ -54,24 +161,32 @@ body { line-height: 1.5; } -.content>header { +header { margin-bottom: 30px; } -.content>header nav { +nav { font-family: "Fira Sans", Helvetica, Arial, sans-serif; } /* Basic markup elements */ b, strong { - font-weight: 500; + font-weight: bold; } -i, em { +i { font-style: italic; } +em, i em.odd{ + font-style: italic; +} + +em.odd, i em { + font-style: normal; +} + sup { vertical-align: super; } @@ -86,15 +201,6 @@ sup, sub { margin-left: 0.2ex; } -pre { - margin-top: 0.8em; - margin-bottom: 1.2em; -} - -p, ul, ol { - margin-top: 0.5em; - margin-bottom: 1em; -} ul, ol { list-style-position: outside } @@ -129,32 +235,32 @@ li>*:first-child { a { text-decoration: none; - color: #2C5CBD; + color: var(--link-color); } a:hover { - box-shadow: 0 1px 0 0 #2C5CBD; + box-shadow: 0 1px 0 0 var(--link-color); } /* Linked highlight */ *:target { - background-color: rgba(187,239,253,0.3) !important; - box-shadow: 0 0px 0 1px rgba(187,239,253,0.8) !important; + background-color: var(--target-background) !important; + box-shadow: 0 0px 0 1px var(--target-shadow) !important; border-radius: 1px; } -*:hover>a.anchor { +*:hover > a.anchor { visibility: visible; } a.anchor:before { - content: "#" + content: "#"; } a.anchor:hover { box-shadow: none; text-decoration: none; - color: #555; + color: var(--anchor-hover); } a.anchor { @@ -168,7 +274,7 @@ a.anchor { padding-right: 0.4em; padding-left: 0.4em; /* To remain selectable */ - color: #d5d5d5; + color: var(--anchor-color); } .spec > a.anchor { @@ -177,10 +283,10 @@ a.anchor { } .xref-unresolved { - color: #2C5CBD; + color: #2C94BD; } .xref-unresolved:hover { - box-shadow: 0 1px 0 0 #CC6666; + box-shadow: 0 1px 0 0 var(--xref-shadow); } /* Section and document divisions. @@ -190,7 +296,6 @@ a.anchor { h1, h2, h3, h4, h5, h6, .h7, .h8, .h9, .h10 { font-family: "Fira Sans", Helvetica, Arial, sans-serif; font-weight: 400; - margin: 0.5em 0 0.5em 0; padding-top: 0.1em; line-height: 1.2; overflow-wrap: break-word; @@ -199,13 +304,12 @@ h1, h2, h3, h4, h5, h6, .h7, .h8, .h9, .h10 { h1 { font-weight: 500; font-size: 2.441em; - margin-top: 1.214em; } h1 { font-weight: 500; font-size: 1.953em; - box-shadow: 0 1px 0 0 #ddd; + box-shadow: 0 1px 0 0 var(--header-shadow); } h2 { @@ -244,6 +348,22 @@ h4 { font-size: 1.12em; } +/* Comment delimiters, hidden but accessible to screen readers and + selected for copy/pasting */ + +/* Taken from bootstrap */ +/* See also https://stackoverflow.com/a/27769435/4220738 */ +.comment-delim { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + border: 0; +} /* Preformatted and code */ @@ -254,20 +374,25 @@ tt, code, pre { pre { padding: 0.1em; - border: 1px solid #eee; + border: 1px solid var(--pre-border-color); border-radius: 5px; overflow-x: auto; } -p code, li code { - background-color: #f6f8fa; - color: #0d2b3e; +p code, +li code { + background-color: var(--li-code-background); + color: var(--li-code-color); border-radius: 3px; padding: 0 0.3ex; } p a > code { - color: #2C5CBD; + color: var(--link-color); +} + +code { + white-space: pre-wrap; } /* Code blocks (e.g. Examples) */ @@ -282,42 +407,25 @@ pre code { font-weight: 500; } +.arrow { white-space: nowrap } + /* Module member specification */ -.spec:not(.include), .spec.include details summary { - background-color: #f6f8fa; +.spec { + background-color: var(--spec-summary-background); border-radius: 3px; - border-left: 4px solid #5c9cf5; + border-left: 4px solid var(--spec-summary-border-color); border-right: 5px solid transparent; padding: 0.35em 0.5em; } -.spec.include details summary:hover { - background-color: #ebeff2; -} - -dl, div.spec, .doc, aside { - margin-bottom: 20px; -} - -dl > dd { - padding: 0.5em; -} - -dd> :first-child { - margin-top: 0; -} - -dl:last-child, dd> :last-child, aside:last-child, article:last-child { - margin-bottom: 0; +.def-doc { + margin-bottom: 10px; } -dt+dt { - margin-top: 15px; -} - -section+section, section > header + dl { - margin-top: 25px; +/* Spacing between items */ +div.odoc-spec,.odoc-include { + margin-bottom: 2em; } .spec.type .variant { @@ -341,27 +449,26 @@ div.def { padding-left: 2ex; } -div.def+div.doc { +div.def+div.def-doc { margin-left: 1ex; margin-top: 2.5px } -div.doc>*:first-child { +div.def-doc>*:first-child { margin-top: 0; } -/* The elements other than heading should be wrapped in