Skip to content

Commit

Permalink
Merge 5c481ea into 090ce0d
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoonroad committed Mar 27, 2022
2 parents 090ce0d + 5c481ea commit a970fd4
Show file tree
Hide file tree
Showing 44 changed files with 361 additions and 345 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/coverage-report.yml
Expand Up @@ -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 }}
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/macos-ci.yml
Expand Up @@ -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 }}

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ubuntu-ci.yml
Expand Up @@ -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 }}

Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/windows-ci.yml
Expand Up @@ -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 }}

Expand Down
18 changes: 5 additions & 13 deletions Makefile
Expand Up @@ -92,19 +92,11 @@ 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/
@ find . -name '*.coverage' | xargs rm -f
@ dune runtest --instrument-with bisect_ppx --force
@ bisect-ppx-report html --title twostep
@ mv ./_coverage/* ./docs/apicov/
@ bisect-ppx-report summary

report: coverage
@ bisect-ppx-report send-to Coveralls
Expand Down
2 changes: 1 addition & 1 deletion VERSION
@@ -1 +1 @@
1.0.0
1.0.1
10 changes: 4 additions & 6 deletions docs/apicov/coverage.css
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

Expand Down
74 changes: 37 additions & 37 deletions docs/apicov/lib/base32.ml.html
Expand Up @@ -439,88 +439,88 @@ <h2>100.00%</h2>


let reverse_base32_alphabet = function
| <span data-count="97">'</span>a' -&gt;
| <span data-count="32">'</span>a' -&gt;
0
| <span data-count="50">'</span>b' -&gt;
| <span data-count="17">'</span>b' -&gt;
1
| <span data-count="57">'</span>c' -&gt;
| <span data-count="2">'</span>c' -&gt;
2
| <span data-count="57">'</span>d' -&gt;
| <span data-count="60">'</span>d' -&gt;
3
| <span data-count="20">'</span>e' -&gt;
| <span data-count="53">'</span>e' -&gt;
4
| <span data-count="37">'</span>f' -&gt;
| <span data-count="68">'</span>f' -&gt;
5
| <span data-count="105">'</span>g' -&gt;
| <span data-count="49">'</span>g' -&gt;
6
| <span data-count="114">'</span>h' -&gt;
| <span data-count="16">'</span>h' -&gt;
7
| <span data-count="74">'</span>i' -&gt;
| <span data-count="19">'</span>i' -&gt;
8
| <span data-count="16">'</span>j' -&gt;
| <span data-count="56">'</span>j' -&gt;
9
| <span data-count="62">'</span>k' -&gt;
| <span data-count="44">'</span>k' -&gt;
10
| <span data-count="59">'</span>l' -&gt;
11
| <span data-count="22">'</span>m' -&gt;
| <span data-count="74">'</span>m' -&gt;
12
| <span data-count="56">'</span>n' -&gt;
| <span data-count="105">'</span>n' -&gt;
13
| <span data-count="16">'</span>o' -&gt;
| <span data-count="71">'</span>o' -&gt;
14
| <span data-count="62">'</span>p' -&gt;
| <span data-count="68">'</span>p' -&gt;
15
| <span data-count="68">'</span>q' -&gt;
| <span data-count="56">'</span>q' -&gt;
16
| <span data-count="13">'</span>r' -&gt;
| <span data-count="25">'</span>r' -&gt;
17
| <span data-count="16">'</span>s' -&gt;
| <span data-count="34">'</span>s' -&gt;
18
| <span data-count="44">'</span>t' -&gt;
| <span data-count="124">'</span>t' -&gt;
19
| <span data-count="77">'</span>u' -&gt;
| <span data-count="68">'</span>u' -&gt;
20
| <span data-count="56">'</span>v' -&gt;
| <span data-count="77">'</span>v' -&gt;
21
| <span data-count="56">'</span>w' -&gt;
| <span data-count="87">'</span>w' -&gt;
22
| <span data-count="62">'</span>x' -&gt;
| <span data-count="7">'</span>x' -&gt;
23
| <span data-count="71">'</span>y' -&gt;
| <span data-count="44">'</span>y' -&gt;
24
| <span data-count="71">'</span>z' -&gt;
| <span data-count="59">'</span>z' -&gt;
25
| <span data-count="43">'</span>2' -&gt;
| <span data-count="34">'</span>2' -&gt;
26
| <span data-count="31">'</span>3' -&gt;
| <span data-count="68">'</span>3' -&gt;
27
| <span data-count="4">'</span>4' -&gt;
| <span data-count="84">'</span>4' -&gt;
28
| <span data-count="7">'</span>5' -&gt;
| <span data-count="25">'</span>5' -&gt;
29
| <span data-count="16">'</span>6' -&gt;
| <span data-count="10">'</span>6' -&gt;
30
| <span data-count="130">'</span>7' -&gt;
| <span data-count="74">'</span>7' -&gt;
31
| <span data-count="1">w</span>at -&gt;
failwith ("Invalid base32 character: " ^ Base.String.of_cha<span data-count="1">r</span> wat)


let rec enc_loop data ~basis ~alphabet number =
<span data-count="8828">i</span>f number &lt;= 0
then <span data-count="1638">d</span>ata
<span data-count="9614">i</span>f number &lt;= 0
then <span data-count="1737">d</span>ata
else
<span data-count="7190">l</span>et remainder = number mod basis in
<span data-count="7877">l</span>et remainder = number mod basis in
let result = number / basis in
let digit = List.nth alphabet remainder in
<span data-count="7190">e</span>nc_loop (digit ^ data) ~basis ~alphabet result
<span data-count="7877">e</span>nc_loop (digit ^ data) ~basis ~alphabet result


let int_to_base_x ~basis ~alphabet number =
<span data-count="1784">i</span>f number &lt; basis
then <span data-count="146">L</span>ist.nth alphabet number
else <span data-count="1638">e</span>nc_loop "" ~basis ~alphabet number
then <span data-count="47">L</span>ist.nth alphabet number
else <span data-count="1737">e</span>nc_loop "" ~basis ~alphabet number


let base32_to_string ?(size = <span data-count="85">1</span>0) base32 =
Expand Down
6 changes: 3 additions & 3 deletions docs/apicov/lib/helpers.ml.html
Expand Up @@ -88,10 +88,10 @@ <h2>100.00%</h2>
<span data-count="1922">l</span>et length = String.length msg in
<span data-count="1922">l</span>et remainder = length mod basis in
if remainder = 0
then <span data-count="955">m</span>sg
then <span data-count="1043">m</span>sg
else
<span data-count="967">l</span>et zerofill = String.make (basis - remainder) byte in
<span data-count="967">m</span>atch direction with <span data-count="5">O</span>nRight -&gt; msg ^ zerofill | <span data-count="962">O</span>nLeft -&gt; zerofill ^ msg
<span data-count="879">l</span>et zerofill = String.make (basis - remainder) byte in
<span data-count="879">m</span>atch direction with <span data-count="5">O</span>nRight -&gt; msg ^ zerofill | <span data-count="874">O</span>nLeft -&gt; zerofill ^ msg
</code></pre>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions docs/apicov/lib/twostep.ml.html
Expand Up @@ -376,7 +376,7 @@ <h2>100.00%</h2>

let code
?(window = <span data-count="18">3</span>0) ?(drift = <span data-count="11">0</span>) ?(digits = <span data-count="14">6</span>) ?(hash = <span data-count="17">"</span>SHA-1") ~secret () =
<span data-count="42">a</span>ssert (digits = <span data-count="40">6</span> || digits = <span data-count="2">8</span>) ;
<span data-count="42">a</span>ssert <span data-count="42">(</span>digits = <span data-count="40">6</span> || digits = <span data-count="2">8</span>) ;
let decoded = Base32.base32_to_string secret in
<span data-count="41">l</span>et counter = Time.counter ~timestep:window ~drift () in
<span data-count="41">l</span>et image = Hmac.hmac ~hash ~secret:decoded counter in
Expand Down Expand Up @@ -429,7 +429,7 @@ <h2>100.00%</h2>


let codes ?(digits = <span data-count="3">6</span>) ?(hash = <span data-count="3">"</span>SHA-1") ?(amount = <span data-count="2">1</span>) ~counter ~secret () =
<span data-count="17">a</span>ssert (amount &gt;= 1) ;
<span data-count="17">a</span>ssert <span data-count="17">(</span>amount &gt;= 1) ;
let step index = <span data-count="43">c</span>ode ~digits ~hash ~counter:(counter + index) ~secret () in
Base.List.init amount ~f:step

Expand All @@ -442,8 +442,8 @@ <h2>100.00%</h2>
~secret
~codes:numbers
() =
<span data-count="4">a</span>ssert (ahead &gt;= 0) ;
assert (Base.List.lengt<span data-count="4">h</span> numbers &gt;= 1) ;
<span data-count="4">a</span>ssert <span data-count="4">(</span>ahead &gt;= 0) ;
assert <span data-count="4">(</span>Base.List.lengt<span data-count="4">h</span> numbers &gt;= 1) ;
let amount = Base.List.length numbers in
<span data-count="4">l</span>et step index =
<span data-count="14">l</span>et valid =
Expand Down
2 changes: 1 addition & 1 deletion docs/apiref/index.html
Expand Up @@ -11,7 +11,7 @@
<div class="by-name">
<h2>OCaml package documentation</h2>
<ol>
<li><a href="twostep/index.html">twostep</a> <span class="version">1.0.0</span></li>
<li><a href="twostep/index.html">twostep</a> <span class="version">1.0.1</span></li>
</ol>
</div>
</main>
Expand Down

0 comments on commit a970fd4

Please sign in to comment.