Skip to content

Commit

Permalink
Manually disable a few auto formats
Browse files Browse the repository at this point in the history
  • Loading branch information
vaivaswatha committed Jan 16, 2020
1 parent 843b812 commit 959ad36
Show file tree
Hide file tree
Showing 5 changed files with 514 additions and 979 deletions.
184 changes: 16 additions & 168 deletions src/base/Bech32.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,177 +29,25 @@ let bech32_payload_len = 32

let bech32_chk_len = 6

[@@@ocamlformat "disable"]

(* The set of core characters in a bech32 address. *)
let charset =
Array.of_list
[
'q';
'p';
'z';
'r';
'y';
'9';
'x';
'8';
'g';
'f';
'2';
't';
'v';
'd';
'w';
'0';
's';
'3';
'j';
'n';
'5';
'4';
'k';
'h';
'c';
'e';
'6';
'm';
'u';
'a';
'7';
'l';
]
let charset = Array.of_list
['q';'p';'z';'r';'y';'9';'x';'8';'g';'f';'2';'t';'v';'d';'w';'0';'s';'3';'j';'n';'5';'4';'k';'h';'c';'e';'6';'m';'u';'a';'7';'l']

(* Mapping from a 5-bit value to it's bech32 character above. *)
let charset_rev =
Array.of_list
[
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
15;
-1;
10;
17;
21;
20;
26;
30;
7;
5;
-1;
-1;
-1;
-1;
-1;
-1;
-1;
29;
-1;
24;
13;
25;
9;
8;
23;
-1;
18;
22;
31;
27;
19;
-1;
1;
0;
3;
16;
11;
28;
12;
14;
6;
4;
2;
-1;
-1;
-1;
-1;
-1;
-1;
29;
-1;
24;
13;
25;
9;
8;
23;
-1;
18;
22;
31;
27;
19;
-1;
1;
0;
3;
16;
11;
28;
12;
14;
6;
4;
2;
-1;
-1;
-1;
-1;
-1;
]
let charset_rev = Array.of_list [
-1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1;
-1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1;
-1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1; -1;
15; -1; 10; 17; 21; 20; 26; 30; 7; 5; -1; -1; -1; -1; -1; -1;
-1; 29; -1; 24; 13; 25; 9; 8; 23; -1; 18; 22; 31; 27; 19; -1;
1; 0; 3; 16; 11; 28; 12; 14; 6; 4; 2; -1; -1; -1; -1; -1;
-1; 29; -1; 24; 13; 25; 9; 8; 23; -1; 18; 22; 31; 27; 19; -1;
1; 0; 3; 16; 11; 28; 12; 14; 6; 4; 2; -1; -1; -1; -1; -1
]

[@@@ocamlformat "enable"]

(* https://github.com/sipa/bech32/blob/master/ref/c/segwit_addr.c *)
let bech32_polymod_step pre =
Expand Down
Loading

0 comments on commit 959ad36

Please sign in to comment.