├── baccarat.html ├── baccaratsingle.html ├── bingo.html ├── blackjack.html ├── blackjack_readme.md ├── classicdice.html ├── classicdice_new.html ├── coinflip.html ├── coinflip_new.html ├── color.html ├── crash.html ├── double.html ├── egyptianAdventure.pdf ├── fast_crash.html ├── hashdice.html ├── hilo.html ├── jade.html ├── keno.html ├── keno_single.html ├── lib ├── GoogleAnalytics.js ├── SobResult.js ├── babel.min.js ├── bootstrap │ ├── css │ │ ├── bootstrap-grid.css │ │ ├── bootstrap-grid.css.map │ │ ├── bootstrap-grid.min.css │ │ ├── bootstrap-grid.min.css.map │ │ ├── bootstrap-reboot.css │ │ ├── bootstrap-reboot.css.map │ │ ├── bootstrap-reboot.min.css │ │ ├── bootstrap-reboot.min.css.map │ │ ├── bootstrap.css │ │ ├── bootstrap.css.map │ │ ├── bootstrap.min.css │ │ └── bootstrap.min.css.map │ └── js │ │ ├── bootstrap.bundle.js │ │ ├── bootstrap.bundle.js.map │ │ ├── bootstrap.bundle.min.js │ │ ├── bootstrap.bundle.min.js.map │ │ ├── bootstrap.js │ │ ├── bootstrap.js.map │ │ ├── bootstrap.min.js │ │ └── bootstrap.min.js.map ├── card.js ├── crypto-js.js ├── highlight.css ├── highlight.min.js ├── hooks.js ├── jquery.js ├── main.css ├── mobx.umd.production.min.js ├── react-dom.production.min.js ├── react.production.min.js ├── tools.js ├── utils.js └── vue.min.js ├── limbo.html ├── lottery.html ├── mines.html ├── oriental-beauties.html ├── parity.html ├── patti.html ├── plinko.html ├── ringOfFortune.html ├── ringOfFortune_new.html ├── roulette.html ├── roulettesingle.html ├── roulettesingle_new.html ├── saviourSword.pdf ├── sicbo-multiplayer.html ├── slots.html ├── stellar_rush.html ├── sword.html ├── tower.html ├── twist.html ├── ultimatedice.html ├── ultimatedice_new.html ├── videopoker.html └── wheel.html /baccaratsingle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Baccarat Single Verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 29 | 30 | 31 |
32 | 234 | 235 | 236 | -------------------------------------------------------------------------------- /bingo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Bingo verify 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

Bingo verify

22 |
23 |
24 |

Input

25 |
26 | 28 |
29 |
30 | 32 |
33 |
34 | 35 |
36 |
37 |
38 |
39 |

Output

40 |
41 | 42 | 43 |
44 |
45 | 46 | 47 |
48 |
49 |
50 |
51 |

Results

52 |
Final Result Balls (Click each to process)
53 |
54 | 55 | 56 | 57 | 64 | 65 | 66 |
62 | {{result}} 63 |
67 |
68 |
{{ordinalNumber(resultIndex + 1)}} Ball Generate Process
69 |

Using the formula `hmac_sha256(client_seed:nonce, server_seed)`,

70 |

We get the hash result:

71 |

`{{result_hash}}`.

72 |
73 |
    74 |
  1. Take the first 15 characters, resulting in `{{baseHash}}`.
  2. 75 |
  3. Convert this to decimal, which gives: `{{BigInt('0x' + baseHash)}}`.
  4. 76 |
  5. Perform modulus 47(47 is fixed constant), and we get a remainder of {{index}}.
  6. 77 |
  7. Starting from the index, take 14 characters, resulting in `{{newHash}}`.
  8. 78 |
  9. Convert this to decimal, resulting in: `{{BigInt('0x' + newHash)}}`.
  10. 79 |
  11. Divide by 8(8 is a fixed constant), resulting in: `{{BigInt('0x' + newHash) / BigInt(8)}}`.
  12. 80 |
  13. Multiply by 2^-53(2^-53 is a fixed constant), resulting in: `{{Number(BigInt('0x' + newHash) / BigInt(8)) * Math.pow(2, -53)}}`.
  14. 81 |
  15. Finally, Multiply by {{lastedOriginalCards[resultIndex].originalCards.length}}(51 balls - {{resultIndex}} generated), resulting in: `{{Number(BigInt('0x' + newHash) / 82 | BigInt(8)) * Math.pow(2, -53) * lastedOriginalCards[resultIndex].originalCards.length}}`.
  16. 83 |
84 |

The lasted ball num is: {{results[resultIndex]}}

85 |
86 | 87 | 88 | 89 | 96 | 97 | 98 |
94 | {{card}} 95 |
99 |
100 |
101 |
102 | 103 | 104 | 105 | 176 | 177 | -------------------------------------------------------------------------------- /blackjack.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Blackjack Verify 8 | 9 | 10 | 11 | 108 | 109 | 110 |
111 |
112 |

Blackjack Verify

113 |
114 |
115 | 116 | 117 |
118 |
119 | 120 |
121 |
122 |
123 |

Card generation algorithm

124 |
125 | 132 | 213 | 221 | 222 | 223 | -------------------------------------------------------------------------------- /blackjack_readme.md: -------------------------------------------------------------------------------- 1 | ##BLACKJACK 2 | 3 | Blackjack, also known as twenty-one, where players dealt two cards, reaching a final score higher than the dealer without exceeding 21 win, is a comparing card game between usually several players and a dealer. 4 | 5 | ##Game Table 6 | 7 | Players are each dealt two cards (face up). The dealer is also dealt two cards, one up (exposed) and one down (hidden) 8 | Players are allowed to draw additional cars (HIT) or not draw (Stand) when the sum of the cards values is not exceeding 21. 9 | Once all the players have completed their hands, the dealer then reveals the hidden card and must hit until the cards total 17 or more points. Points Calculation 10 | Ace means 1 or 11 points 11 | King, Queen, Jack are all worth ten 12 | Other cards is their pip value (2 through 10) Blackjack 13 | Get 21 points on the player’s first two card (called a “blackjack”), then players receive 1.5x of the bet. (1.5 to 1) Bust 14 | When player’s hand exceeds 21 points, the player loses his bet. Push 15 | If the player and dealer have the same total, it’s called a push. Stand 16 | Take no more cards. For example, when player or dealer’s hand is more than 17 points, they may choose to stay. Hit 17 | Take another card from the dealer. Surrender 18 | When the player surrenders, the house takes half the player's bet and returns the other half to the player (only available as first decision of a hand) Insurance 19 | If the dealer’s upcard is an ace, the player is offered the option of taking “insurance”, the amount of which is half the size of player’s original bet. 20 | When the dealer has blackjack, it pays 2:1 (meaning that the player receives two dollars for every dollar bet) 21 | When the dealer does not have blackjack, the player loses the insurance bet. Even Money 22 | When dealer’s upcard is an ace, before player buying an insurance, Even Money is offered to a player with blackjack. In case the dealer has a blackjack, the player will push on the original bet and get a 2 to 1 payout on the even money side bet. In case the player does not choose Even Money, and the dealer has a blackjack, it’s a push. 23 | ##Double Down 24 | 25 | The player is allowed to increase the initial bet by up to 100% in exchange for committing to stand after receiving exactly one more card. If the player has a black jack, double down is not allowed. 26 | ##Split 27 | 28 | The player is allowed to increase the initial bet by up to 100% in exchange for committing to stand after receiving exactly one more card. -------------------------------------------------------------------------------- /classicdice.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ClassicDice verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

ClassicDice verify

19 |
20 |
21 |

Input

22 |
23 | 24 |
25 |
26 | 27 |
28 |
29 | 30 |
31 |
32 | 33 |
34 |
35 |
36 |
37 |

Output

38 |
39 | 40 | 41 |
42 |
43 | 44 | 45 |
46 |
47 |
48 |
49 |

Results

50 |
Final Result
51 |
hmac_sha256(client_seed:nonce, server_seed)
52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
{{ item }}
{{ item }}
63 |
64 |
Bytes to Number
65 |
66 | ({{results.hex[0] + ', ' + results.hex[1] + ', ' + results.hex[2] + ', ' + results.hex[3]}}) -> [0, ... 4] = {{Math.floor(numResult * 100.01 * 100) / 100}} 67 |
       {{Number(results.hex[0] / 256).toFixed(9)}}    ({{results.hex[0]}} / (256 ^ 1))
68 |
+    {{Number(results.hex[1] / (256 * 256)).toFixed(9)}}    ({{results.hex[1]}} / (256 ^ 2))
69 |
+    {{Number(results.hex[2] / (256 * 256 * 256)).toFixed(9)}}    ({{results.hex[2]}} / (256 ^ 3))
70 |
+    {{Number(results.hex[3] / (256 * 256 * 256 * 256)).toFixed(9)}}    ({{results.hex[3]}} / (256 ^ 4))
71 |
=    {{numResult}}     (* 10001 / 100)
72 |
=    {{Number(numResult * 100.01).toFixed(9)}}
73 |
74 |
75 |
76 | 77 | 142 | -------------------------------------------------------------------------------- /classicdice_new.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ClassicDice verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |

ClassicDice verify

20 |
21 |
22 |

Input

23 |
24 | 25 |
26 |
27 | 28 |
29 |
30 | 31 |
32 |
33 | 34 |
35 |
36 |
37 |
38 |

Output

39 |
40 | 41 | 42 |
43 |
44 | 45 | 46 |
47 |
48 |
49 |
50 |

Results

51 |
Final Result
52 | 53 |
Calculation Process
54 |

Using the formula `hmac_sha256(client_seed:nonce, server_seed)`,

55 |

We get the hash result:

56 |

`{{result_hash}}`.

57 |
58 |
    59 |
  1. Take the first 15 characters, resulting in `{{baseHash}}`.
  2. 60 |
  3. Convert this to decimal, which gives: `{{BigInt('0x' + baseHash)}}`.
  4. 61 |
  5. Perform modulus 47(47 is fixed constant), and we get a remainder of {{index}}.
  6. 62 |
  7. Starting from the index, take 14 characters, resulting in `{{newHash}}`.
  8. 63 |
  9. Convert this to decimal, resulting in: `{{BigInt('0x' + newHash)}}`.
  10. 64 |
  11. Divide by 8(8 is a fixed constant), resulting in: `{{BigInt('0x' + newHash) / BigInt(8)}}`.
  12. 65 |
  13. Multiply by 2^-53(2^-53 is a fixed constant), resulting in: `{{Number(BigInt('0x' + newHash) / BigInt(8)) * Math.pow(2, -53)}}`.
  14. 66 |
  15. Multiply by 10000(10000 is a fixed constant), resulting in: `{{Number(BigInt('0x' + newHash) / BigInt(8)) * Math.pow(2, -53) * 10000}}`.
  16. 67 |
  17. Finally, take the integer part of the result, which gives: `{{numResult}}`.
  18. 68 |
69 |
70 |
71 |
72 | 73 | 128 | -------------------------------------------------------------------------------- /coinflip.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | CoinFLip Verify 8 | 9 | 10 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
37 | 164 | 165 | 166 | -------------------------------------------------------------------------------- /coinflip_new.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | CoinFLip Verify 8 | 9 | 10 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 |
38 | 149 | 150 | 151 | -------------------------------------------------------------------------------- /color.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Color verify 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |

Color verify

21 |
22 |
23 |

Input

24 |
25 | 27 |
28 |
29 | 31 |
32 |
33 | 34 |
35 |
36 |
37 |
38 |

Output

39 |
40 | 41 | 43 |
44 |
45 | 46 | 47 |
48 |
49 |
50 |
51 |

Final Result

52 | {{ resultList }} 53 |
54 |
55 | 56 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /egyptianAdventure.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcgame-project/verify/5af2cd9461d17bc538fcf529a33db98e2df607b9/egyptianAdventure.pdf -------------------------------------------------------------------------------- /fast_crash.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ClassicDice verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

Fast Crash Verify

19 |
20 |
21 |

Input

22 |
23 | 24 |
25 |
26 | 27 |
28 |
29 | 30 |
31 |
32 | 33 |
34 |
35 |
36 |
37 |

Output

38 |
39 | 40 | 41 |
42 |
43 | 44 | 45 |
46 |
47 |
48 |
49 |

Results

50 |
Final Result
51 |
hmac_sha256(client_seed:nonce, server_seed)
52 | 53 |
54 |
55 | 56 | 110 | -------------------------------------------------------------------------------- /hashdice.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | HashDice verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

HashDice verify

19 |
20 |
21 |

Input

22 |
23 | 24 |
25 |
26 | 27 |
28 |
29 | 30 |
31 |
32 | 33 |
34 |
35 |
36 |
37 |

Output

38 |
39 | 40 | 41 |
42 |
43 | 44 | 45 |
46 |
47 |
48 |
49 |

Results

50 |
Final Result
51 |
hmac_sha512(client_seed:nonce, server_seed)
52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
{{ item }}
{{ item }}
63 |
64 |
Bytes to Number
65 |
66 | 67 |
68 |
69 |
70 | 71 | 136 | -------------------------------------------------------------------------------- /hilo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Hilo Verify 8 | 9 | 10 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 |
60 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /jade.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Jade verify 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 |

Jade verify

21 |
22 |
23 |

Input

24 |
25 | 27 |
28 |
29 | 31 |
32 |
33 | 34 |
35 |
36 |
37 |
38 |

Output

39 |
40 | 41 | 43 |
44 |
45 | 46 | 47 |
48 |
49 |
50 |
51 |

Final Result

52 | {{ resultList }} 53 |
54 |
55 | 56 | 131 | 132 | -------------------------------------------------------------------------------- /keno_single.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Keno Single verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |

Keno Single verify

18 |
19 |
20 |

Input

21 |
22 | 28 |
29 |
30 | 36 |
37 |
38 | 44 |
45 |
46 |
47 |
48 |

Output

49 |
50 | 51 | 56 |
57 |
58 | 59 | 60 |
61 |
62 |
63 |
64 |

Final Result

65 | {{ resultList }} 66 |
67 |
68 | 69 | 155 | -------------------------------------------------------------------------------- /lib/GoogleAnalytics.js: -------------------------------------------------------------------------------- 1 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 2 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 3 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 4 | })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); 5 | ga('create', '251190821', 'auto'); -------------------------------------------------------------------------------- /lib/SobResult.js: -------------------------------------------------------------------------------- 1 | const base_csv = `1,3,4,3,2,3 2 | 2,7,2,9,7,8 3 | 3,10,9,10,11,6 4 | 4,9,8,9,8,9 5 | 5,7,10,4,9,10 6 | 6,8,8,8,3,2 7 | 7,10,9,7,8,10 8 | 8,6,11,10,10,9 9 | 9,9,5,2,11,7 10 | 10,8,9,13,6,1 11 | 11,4,8,13,8,10 12 | 12,10,10,13,9,5 13 | 13,8,8,1,3,7 14 | 14,9,5,8,10,10 15 | 15,10,10,10,1,12 16 | 16,8,13,9,8,8 17 | 17,2,13,11,7,10 18 | 18,10,13,9,9,9 19 | 19,7,13,10,2,13 20 | 20,5,7,8,6,13 21 | 21,10,5,10,10,13 22 | 22,3,4,12,3,9 23 | 23,8,7,9,9,10 24 | 24,7,6,1,8,8 25 | 25,12,10,8,4,12 26 | 26,6,5,10,13,9 27 | 27,10,6,1,13,2 28 | 28,2,10,9,13,10 29 | 29,9,1,8,13,1 30 | 30,7,10,12,9,10 31 | 31,8,11,3,3,9 32 | 32,10,7,9,7,7 33 | 33,12,10,7,10,12 34 | 34,7,4,12,1,1 35 | 35,8,9,3,10,10 36 | 36,9,11,8,11,8 37 | 37,10,6,11,9,9 38 | 38,8,9,6,2,13 39 | 39,6,1,13,7,13 40 | 40,12,6,13,3,13 41 | 41,7,8,13,1,9 42 | 42,10,10,9,9,6 43 | 43,8,3,11,8,6 44 | 44,9,2,2,10,2 45 | 45,3,10,3,11,12 46 | 46,5,7,10,9,3 47 | 47,1,11,5,1,10 48 | 48,7,6,7,4,4 49 | 49,12,5,2,5,9 50 | 50,9,13,5,3,7 51 | 51,8,13,9,10,1 52 | 52,1,13,8,8,10 53 | 53,7,13,7,4,4 54 | 54,5,1,12,5,12 55 | 55,10,8,10,9,5 56 | 56,9,9,4,2,8 57 | 57,4,10,9,10,3 58 | 58,9,4,11,3,10 59 | 59,10,3,4,9,4 60 | 60,7,5,5,8,10 61 | 61,5,10,8,4,0 62 | 62,10,9,9,13,0 63 | 63,12,11,6,13,0 64 | 64,9,8,1,13,0 65 | 65,6,9,13,13,0 66 | 66,7,7,13,6,0 67 | 67,2,6,13,8,0 68 | 68,9,9,3,5,0 69 | 69,4,7,6,9,0 70 | 70,5,8,7,4,0 71 | 71,1,10,2,11,0 72 | 72,7,3,11,5,0 73 | 73,8,5,6,2,0 74 | 74,10,10,12,10,0 75 | 75,9,9,7,8,0 76 | 76,4,7,6,4,0 77 | 77,8,8,10,3,0 78 | 78,3,3,4,5,0 79 | 79,10,7,9,2,0 80 | 80,6,2,5,10,0 81 | 81,0,10,10,0,0 82 | 82,0,6,8,0,0 83 | 83,0,10,9,0,0 84 | 84,0,8,7,0,0 85 | 85,0,4,2,0,0 86 | 86,0,3,7,0,0 87 | 87,0,0,0,0,0 88 | 88,0,0,0,0,0 89 | 89,0,0,0,0,0 90 | 90,0,0,0,0,0 91 | 91,0,0,0,0,0 92 | 92,0,0,0,0,0 93 | 93,0,0,0,0,0 94 | 94,0,0,0,0,0 95 | 95,0,0,0,0,0 96 | 96,0,0,0,0,0 97 | 97,0,0,0,0,0 98 | 98,0,0,0,0,0 99 | 99,0,0,0,0,0 100 | 100,0,0,0,0,0 101 | 101,0,0,0,0,0 102 | 102,0,0,0,0,0 103 | 103,0,0,0,0,0 104 | 104,0,0,0,0,0 105 | 105,0,0,0,0,0 106 | 106,0,0,0,0,0`; 107 | 108 | const free_csv = `1,3,4,3,2,3 109 | 2,6,2,9,7,8 110 | 3,4,9,10,11,6 111 | 4,2,3,9,8,4 112 | 5,7,10,4,5,10 113 | 6,5,4,8,3,2 114 | 7,10,9,7,4,13 115 | 8,6,11,6,10,13 116 | 9,4,5,2,11,13 117 | 10,8,9,13,6,1 118 | 11,4,3,13,8,10 119 | 12,10,10,13,5,5 120 | 13,4,6,1,3,6 121 | 14,9,5,8,10,5 122 | 15,1,7,5,1,8 123 | 16,8,13,6,4,3 124 | 17,2,13,11,7,10 125 | 18,9,13,9,5,4 126 | 19,4,13,10,2,7 127 | 20,5,7,4,6,2 128 | 21,10,3,10,10,9 129 | 22,3,4,6,5,4 130 | 23,4,7,9,2,13 131 | 24,6,6,1,8,13 132 | 25,9,5,8,4,13 133 | 26,6,4,5,13,9 134 | 27,10,6,1,13,2 135 | 28,2,10,5,13,10 136 | 29,9,1,8,13,1 137 | 30,4,10,6,9,5 138 | 31,5,11,3,3,4 139 | 32,1,7,9,7,7 140 | 33,7,8,7,10,9 141 | 34,5,4,4,1,1 142 | 35,1,3,5,10,10 143 | 36,9,11,8,11,8 144 | 37,4,6,11,9,4 145 | 38,8,9,6,2,7 146 | 39,6,1,7,7,1 147 | 40,9,6,10,3,10 148 | 41,6,2,3,1,4 149 | 42,10,3,9,9,6 150 | 43,2,5,11,4,13 151 | 44,9,2,2,10,13 152 | 45,4,8,3,11,13 153 | 46,5,7,8,5,3 154 | 47,1,11,6,1,10 155 | 48,7,6,7,4,4 156 | 49,9,5,2,13,9 157 | 50,4,13,5,13,7 158 | 51,5,13,1,13,1 159 | 52,1,13,8,13,10 160 | 53,7,13,7,4,4 161 | 54,5,10,6,5,6 162 | 55,1,6,10,9,5 163 | 56,9,1,4,2,8 164 | 57,4,8,9,10,3 165 | 58,4,4,11,5,10 166 | 59,2,3,4,2,4 167 | 60,7,5,5,8,3 168 | 61,5,6,8,4,0 169 | 62,10,9,9,13,0 170 | 63,6,11,6,13,0 171 | 64,9,8,1,13,0 172 | 65,6,9,13,13,0 173 | 66,10,2,13,6,0 174 | 67,2,6,13,8,0 175 | 68,9,9,8,5,0 176 | 69,4,7,6,3,0 177 | 70,5,8,7,4,0 178 | 71,1,4,2,11,0 179 | 72,7,13,11,5,0 180 | 73,5,13,6,2,0 181 | 74,1,13,8,10,0 182 | 75,9,13,7,8,0 183 | 76,4,7,6,4,0 184 | 77,8,8,10,7,0 185 | 78,9,1,4,5,0 186 | 79,10,7,9,2,0 187 | 80,6,2,5,10,0`; 188 | 189 | const bonus_csv = `1,1,0,0 190 | 2,1,2,40 191 | 3,1,3,50 192 | 4,1,5,60 193 | 5,1,7,30 194 | 6,1,10,15 195 | 7,1,15,10 196 | 8,2,0,50 197 | 9,2,2,35 198 | 10,2,3,45 199 | 11,2,5,55 200 | 12,2,7,100 201 | 13,2,10,30 202 | 14,2,15,15 203 | 15,3,0,150 204 | 16,3,2,40 205 | 17,3,3,50 206 | 18,3,5,60 207 | 19,3,7,60 208 | 20,3,10,80 209 | 21,3,15,60 210 | 22,4,0,475 211 | 23,4,2,20 212 | 24,4,3,30 213 | 25,4,5,40 214 | 26,4,7,50 215 | 27,4,10,240 216 | 28,4,15,200`; 217 | 218 | const lines_csv = `1,1,2,1,1,1 219 | 2,1,2,1,2,2 220 | 3,1,2,2,2,2 221 | 4,1,2,2,3,3 222 | 5,1,2,3,2,1 223 | 6,1,4,3,4,1 224 | 7,2,2,1,2,1 225 | 8,2,2,2,2,1 226 | 9,2,2,2,3,3 227 | 10,2,2,3,2,2 228 | 11,2,3,3,3,2 229 | 12,2,1,1,1,2 230 | 13,2,1,2,1,2 231 | 14,2,1,3,1,2 232 | 15,2,1,2,4,2 233 | 16,3,4,3,3,2 234 | 17,3,4,2,1,1 235 | 18,3,4,2,4,3 236 | 19,3,4,1,4,3 237 | 20,3,3,3,4,3 238 | 21,3,2,2,3,1 239 | 22,3,2,1,2,3 240 | 23,3,1,3,1,3 241 | 24,3,1,2,4,1 242 | 25,3,1,1,1,3`; 243 | 244 | 245 | 246 | class SobResult { 247 | cowNums; 248 | baseData; 249 | freeData; 250 | linesData; 251 | bonusData; 252 | constructor() { 253 | this.cowNums = [3, 4, 3, 4, 3]; 254 | this.baseData = this.formatDataByCSV(base_csv); 255 | this.freeData = this.formatDataByCSV(free_csv); 256 | this.linesData = this.formatLinesByCSV(lines_csv); 257 | this.bonusData = this.formatBonusByCSV(bonus_csv); 258 | } 259 | 260 | 261 | getDataByIndex(data, cowIndexs) { 262 | return this.cowNums.map((num, index) => { 263 | const start = cowIndexs[index]; 264 | const end = start + num; 265 | let dataCow = data[index].concat(data[index].slice(0, num)); 266 | return dataCow.slice(start, end); 267 | }); 268 | } 269 | 270 | getBaseDataByIndex(cowIndexs) { 271 | return this.getDataByIndex(this.baseData, cowIndexs); 272 | } 273 | 274 | getFreeDataByIndex(cowIndexs) { 275 | return this.getDataByIndex(this.freeData, cowIndexs); 276 | } 277 | 278 | 279 | formatCsv(csvData) { 280 | return (csvData) 281 | .split('\n') 282 | .map((it) => it.split(',').map((it) => Number(it))); 283 | } 284 | 285 | 286 | formatDataByCSV(csvData) { 287 | const currData = this.formatCsv(csvData); 288 | const data = [[], [], [], [], []]; 289 | for (let row = 0, totalRow = currData.length; row < totalRow; row++) { 290 | for (let cow = 0; cow < 5; cow++) { 291 | let num = currData[row][cow + 1]; 292 | if (num > 0) { 293 | data[cow].push(num); 294 | } 295 | } 296 | } 297 | return data; 298 | } 299 | 300 | 301 | formatLinesByCSV(csvData) { 302 | const currData = this.formatCsv(csvData); 303 | const data = []; 304 | for (let n = 0, l = currData.length; n < l; n++) { 305 | data.push(currData[n].slice(1)); 306 | } 307 | return data; 308 | } 309 | 310 | 311 | formatBonusByCSV(csvData) { 312 | const currData = this.formatCsv(csvData); 313 | console.log('currData', currData); 314 | const data = [[], [], [], []]; 315 | for (let n = 0, l = currData.length; n < l; n++) { 316 | const row = currData[n]; 317 | console.log('row', row); 318 | data[row[1] - 1].push([row[2], row[3]]); 319 | } 320 | return data; 321 | } 322 | 323 | 324 | getNumsByHash(hash, step = 2) { 325 | let res = []; 326 | for (let i = 0; i < hash.length; i += step) { 327 | let dext = hash[i] + hash[i + 1]; 328 | let hext = parseInt(dext, 16); 329 | res.push(hext); 330 | } 331 | return res; 332 | } 333 | 334 | 335 | getResultNumsByHash(hash, modulusList, step = 4) { 336 | let hashNums = this.getNumsByHash(hash); 337 | return modulusList.map((modulus, i) => { 338 | let nums = hashNums.slice(i * step, (i + 1) * step); 339 | let result = nums 340 | .map((nums, i) => { 341 | return nums / Math.pow(256, i + 1); 342 | }) 343 | .reduce((res, num) => { 344 | return res + num; 345 | }, 0); 346 | return Math.floor(result * modulus); 347 | }); 348 | } 349 | } 350 | 351 | const sobResult = new SobResult(); 352 | -------------------------------------------------------------------------------- /lib/bootstrap/css/bootstrap-reboot.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.3.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors 4 | * Copyright 2011-2019 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */ 8 | *, 9 | *::before, 10 | *::after { 11 | box-sizing: border-box; 12 | } 13 | 14 | html { 15 | font-family: sans-serif; 16 | line-height: 1.15; 17 | -webkit-text-size-adjust: 100%; 18 | -webkit-tap-highlight-color: rgba(0, 0, 0, 0); 19 | } 20 | 21 | article, aside, figcaption, figure, footer, header, hgroup, main, nav, section { 22 | display: block; 23 | } 24 | 25 | body { 26 | margin: 0; 27 | font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; 28 | font-size: 1rem; 29 | font-weight: 400; 30 | line-height: 1.5; 31 | color: #212529; 32 | text-align: left; 33 | background-color: #fff; 34 | } 35 | 36 | [tabindex="-1"]:focus { 37 | outline: 0 !important; 38 | } 39 | 40 | hr { 41 | box-sizing: content-box; 42 | height: 0; 43 | overflow: visible; 44 | } 45 | 46 | h1, h2, h3, h4, h5, h6 { 47 | margin-top: 0; 48 | margin-bottom: 0.5rem; 49 | } 50 | 51 | p { 52 | margin-top: 0; 53 | margin-bottom: 1rem; 54 | } 55 | 56 | abbr[title], 57 | abbr[data-original-title] { 58 | text-decoration: underline; 59 | -webkit-text-decoration: underline dotted; 60 | text-decoration: underline dotted; 61 | cursor: help; 62 | border-bottom: 0; 63 | -webkit-text-decoration-skip-ink: none; 64 | text-decoration-skip-ink: none; 65 | } 66 | 67 | address { 68 | margin-bottom: 1rem; 69 | font-style: normal; 70 | line-height: inherit; 71 | } 72 | 73 | ol, 74 | ul, 75 | dl { 76 | margin-top: 0; 77 | margin-bottom: 1rem; 78 | } 79 | 80 | ol ol, 81 | ul ul, 82 | ol ul, 83 | ul ol { 84 | margin-bottom: 0; 85 | } 86 | 87 | dt { 88 | font-weight: 700; 89 | } 90 | 91 | dd { 92 | margin-bottom: .5rem; 93 | margin-left: 0; 94 | } 95 | 96 | blockquote { 97 | margin: 0 0 1rem; 98 | } 99 | 100 | b, 101 | strong { 102 | font-weight: bolder; 103 | } 104 | 105 | small { 106 | font-size: 80%; 107 | } 108 | 109 | sub, 110 | sup { 111 | position: relative; 112 | font-size: 75%; 113 | line-height: 0; 114 | vertical-align: baseline; 115 | } 116 | 117 | sub { 118 | bottom: -.25em; 119 | } 120 | 121 | sup { 122 | top: -.5em; 123 | } 124 | 125 | a { 126 | color: #007bff; 127 | text-decoration: none; 128 | background-color: transparent; 129 | } 130 | 131 | a:hover { 132 | color: #0056b3; 133 | text-decoration: underline; 134 | } 135 | 136 | a:not([href]):not([tabindex]) { 137 | color: inherit; 138 | text-decoration: none; 139 | } 140 | 141 | a:not([href]):not([tabindex]):hover, a:not([href]):not([tabindex]):focus { 142 | color: inherit; 143 | text-decoration: none; 144 | } 145 | 146 | a:not([href]):not([tabindex]):focus { 147 | outline: 0; 148 | } 149 | 150 | pre, 151 | code, 152 | kbd, 153 | samp { 154 | font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; 155 | font-size: 1em; 156 | } 157 | 158 | pre { 159 | margin-top: 0; 160 | margin-bottom: 1rem; 161 | overflow: auto; 162 | } 163 | 164 | figure { 165 | margin: 0 0 1rem; 166 | } 167 | 168 | img { 169 | vertical-align: middle; 170 | border-style: none; 171 | } 172 | 173 | svg { 174 | overflow: hidden; 175 | vertical-align: middle; 176 | } 177 | 178 | table { 179 | border-collapse: collapse; 180 | } 181 | 182 | caption { 183 | padding-top: 0.75rem; 184 | padding-bottom: 0.75rem; 185 | color: #6c757d; 186 | text-align: left; 187 | caption-side: bottom; 188 | } 189 | 190 | th { 191 | text-align: inherit; 192 | } 193 | 194 | label { 195 | display: inline-block; 196 | margin-bottom: 0.5rem; 197 | } 198 | 199 | button { 200 | border-radius: 0; 201 | } 202 | 203 | button:focus { 204 | outline: 1px dotted; 205 | outline: 5px auto -webkit-focus-ring-color; 206 | } 207 | 208 | input, 209 | button, 210 | select, 211 | optgroup, 212 | textarea { 213 | margin: 0; 214 | font-family: inherit; 215 | font-size: inherit; 216 | line-height: inherit; 217 | } 218 | 219 | button, 220 | input { 221 | overflow: visible; 222 | } 223 | 224 | button, 225 | select { 226 | text-transform: none; 227 | } 228 | 229 | select { 230 | word-wrap: normal; 231 | } 232 | 233 | button, 234 | [type="button"], 235 | [type="reset"], 236 | [type="submit"] { 237 | -webkit-appearance: button; 238 | } 239 | 240 | button:not(:disabled), 241 | [type="button"]:not(:disabled), 242 | [type="reset"]:not(:disabled), 243 | [type="submit"]:not(:disabled) { 244 | cursor: pointer; 245 | } 246 | 247 | button::-moz-focus-inner, 248 | [type="button"]::-moz-focus-inner, 249 | [type="reset"]::-moz-focus-inner, 250 | [type="submit"]::-moz-focus-inner { 251 | padding: 0; 252 | border-style: none; 253 | } 254 | 255 | input[type="radio"], 256 | input[type="checkbox"] { 257 | box-sizing: border-box; 258 | padding: 0; 259 | } 260 | 261 | input[type="date"], 262 | input[type="time"], 263 | input[type="datetime-local"], 264 | input[type="month"] { 265 | -webkit-appearance: listbox; 266 | } 267 | 268 | textarea { 269 | overflow: auto; 270 | resize: vertical; 271 | } 272 | 273 | fieldset { 274 | min-width: 0; 275 | padding: 0; 276 | margin: 0; 277 | border: 0; 278 | } 279 | 280 | legend { 281 | display: block; 282 | width: 100%; 283 | max-width: 100%; 284 | padding: 0; 285 | margin-bottom: .5rem; 286 | font-size: 1.5rem; 287 | line-height: inherit; 288 | color: inherit; 289 | white-space: normal; 290 | } 291 | 292 | progress { 293 | vertical-align: baseline; 294 | } 295 | 296 | [type="number"]::-webkit-inner-spin-button, 297 | [type="number"]::-webkit-outer-spin-button { 298 | height: auto; 299 | } 300 | 301 | [type="search"] { 302 | outline-offset: -2px; 303 | -webkit-appearance: none; 304 | } 305 | 306 | [type="search"]::-webkit-search-decoration { 307 | -webkit-appearance: none; 308 | } 309 | 310 | ::-webkit-file-upload-button { 311 | font: inherit; 312 | -webkit-appearance: button; 313 | } 314 | 315 | output { 316 | display: inline-block; 317 | } 318 | 319 | summary { 320 | display: list-item; 321 | cursor: pointer; 322 | } 323 | 324 | template { 325 | display: none; 326 | } 327 | 328 | [hidden] { 329 | display: none !important; 330 | } 331 | /*# sourceMappingURL=bootstrap-reboot.css.map */ -------------------------------------------------------------------------------- /lib/bootstrap/css/bootstrap-reboot.min.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap Reboot v4.3.1 (https://getbootstrap.com/) 3 | * Copyright 2011-2019 The Bootstrap Authors 4 | * Copyright 2011-2019 Twitter, Inc. 5 | * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) 6 | * Forked from Normalize.css, licensed MIT (https://github.com/necolas/normalize.css/blob/master/LICENSE.md) 7 | */*,::after,::before{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-webkit-tap-highlight-color:transparent}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,"Noto Sans",sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-size:1rem;font-weight:400;line-height:1.5;color:#212529;text-align:left;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0;-webkit-text-decoration-skip-ink:none;text-decoration-skip-ink:none}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg{overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}select{word-wrap:normal}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]:not(:disabled),[type=reset]:not(:disabled),[type=submit]:not(:disabled),button:not(:disabled){cursor:pointer}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important} 8 | /*# sourceMappingURL=bootstrap-reboot.min.css.map */ -------------------------------------------------------------------------------- /lib/card.js: -------------------------------------------------------------------------------- 1 | class Card { 2 | static POINTS = ' ,A,2,3,4,5,6,7,8,9,10,J,Q,K'.split(','); 3 | static SUITS = ['♠', '♥', '♣', '♦']; 4 | cardId; 5 | suit; 6 | suitStr; 7 | point; 8 | pointStr; 9 | 10 | constructor(cardId) { 11 | this.cardId = cardId; 12 | 13 | this.suit = (cardId & 240) / 16 - 10; 14 | this.suitStr = Card.SUITS[this.suit]; 15 | 16 | this.point = cardId % 16; 17 | this.pointStr = Card.POINTS[this.point]; 18 | } 19 | 20 | static encodeByString(suit, point) { 21 | return this.encode(Card.SUITS.indexOf(suit), Card.POINTS.indexOf(point)); 22 | } 23 | 24 | static encode(suit, point) { 25 | return ((suit + 10) << 4) + point; 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /lib/highlight.css: -------------------------------------------------------------------------------- 1 | .hljs{display:block;overflow-x:auto;padding:0.5em;color:#abb2bf;background:#282c34}.hljs-comment,.hljs-quote{color:#5c6370;font-style:italic}.hljs-doctag,.hljs-keyword,.hljs-formula{color:#c678dd}.hljs-section,.hljs-name,.hljs-selector-tag,.hljs-deletion,.hljs-subst{color:#e06c75}.hljs-literal{color:#56b6c2}.hljs-string,.hljs-regexp,.hljs-addition,.hljs-attribute,.hljs-meta-string{color:#98c379}.hljs-built_in,.hljs-class .hljs-title{color:#e6c07b}.hljs-attr,.hljs-variable,.hljs-template-variable,.hljs-type,.hljs-selector-class,.hljs-selector-attr,.hljs-selector-pseudo,.hljs-number{color:#d19a66}.hljs-symbol,.hljs-bullet,.hljs-link,.hljs-meta,.hljs-selector-id,.hljs-title{color:#61aeee}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:bold}.hljs-link{text-decoration:underline} -------------------------------------------------------------------------------- /lib/hooks.js: -------------------------------------------------------------------------------- 1 | 2 | function useMountedState() { 3 | const mountedRef = React.useRef(false); 4 | const get = React.useCallback(() => mountedRef.current, []); 5 | 6 | React.useEffect(() => { 7 | mountedRef.current = true; 8 | 9 | return () => { 10 | mountedRef.current = false; 11 | }; 12 | }, []); 13 | 14 | return get; 15 | } 16 | 17 | function useSetState ( 18 | initialState 19 | ) { 20 | const [state, set] = React.useState(initialState); 21 | const isMounted = useMountedState(); 22 | const setState = React.useCallback( 23 | (patch) => { 24 | if (isMounted()) { 25 | set((prevState) => { 26 | const newState = patch instanceof Function ? patch(prevState) : patch; 27 | const needUpdate = 28 | Object.keys(newState).findIndex( 29 | (it) => prevState[it] !== newState[it] 30 | ) != -1; 31 | if (!needUpdate) return prevState; 32 | return Object.assign({}, prevState, newState); 33 | }); 34 | } 35 | }, 36 | [set] 37 | ); 38 | 39 | return [state, setState]; 40 | } 41 | 42 | window.hooks = { 43 | useMountedState, 44 | useSetState 45 | } 46 | 47 | -------------------------------------------------------------------------------- /lib/main.css: -------------------------------------------------------------------------------- 1 | .main{ 2 | width: 800px; margin: 50px auto; 3 | } 4 | 5 | .cardbox.red{ 6 | color: #f00; 7 | } 8 | .cardbox.black{ 9 | color: #000; 10 | } 11 | #cards{ 12 | clear: both; 13 | } 14 | .card .point{ 15 | position: absolute; 16 | left: 0px; top: 2px; width: 20px; 17 | text-align: center; 18 | } 19 | .card .flower{ 20 | position: absolute; bottom: 20px; right: 10px; 21 | font-size: 30px; 22 | } 23 | .cardbox .index{ 24 | position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; color: #fff; 25 | font-size: 12px; line-height: 20px; 26 | } 27 | .cardbox.active .card, .cardbox:hover .card{ 28 | transform: scale(2); 29 | } 30 | .cardbox.active .index, .cardbox:hover .index{ 31 | bottom: 0; 32 | } 33 | 34 | .cardbox{ 35 | position: relative; 36 | display: inline-block; height: 80px; padding: 15px 15px; 37 | } 38 | .card{ 39 | position: absolute; cursor: pointer; 40 | width: 40px; height: 60px; 41 | background-color: #e8e7f1; 42 | border-radius: 2px; 43 | line-height: 16px; 44 | box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5); 45 | } 46 | .card-list { 47 | 48 | } 49 | @media screen and (max-width: 800px) { 50 | .main{ 51 | width: auto; margin: 50px 10px; 52 | } 53 | } -------------------------------------------------------------------------------- /lib/tools.js: -------------------------------------------------------------------------------- 1 | window.tools = (() => { 2 | function queryString() { 3 | return window.location.search.replace('?', '') 4 | .split('&') 5 | .reduce(function (res, item) { 6 | let kv = item.split('='); 7 | res[kv[0]] = kv[1]; 8 | return res; 9 | }, {}) 10 | } 11 | 12 | function sha256 (value) { 13 | return CryptoJS.SHA256(CryptoJS.enc.Utf8.parse(value)); 14 | } 15 | return { 16 | queryString, 17 | sha256, 18 | } 19 | })(); -------------------------------------------------------------------------------- /lib/utils.js: -------------------------------------------------------------------------------- 1 | const MAX_BORDER = Math.pow(2, -53); 2 | 3 | function slideWindowNumber(hash, events) { 4 | let index = BigInt('0x' + hash.substring(0, 15)); 5 | index = Number(index % BigInt(47)); 6 | let num = BigInt('0x' + hash.substring(index, index + 14)) >> BigInt(3); 7 | num = Number(num) * MAX_BORDER; 8 | return num * events; 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /limbo.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | ClassicDice verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

Limbo verify

19 |
20 |
21 |

Input

22 |
23 | 24 |
25 |
26 | 27 |
28 |
29 | 30 |
31 |
32 | 33 |
34 |
35 |
36 |
37 |

Output

38 |
39 | 40 | 41 |
42 |
43 | 44 | 45 |
46 |
47 |
48 |
49 |

Results

50 |
Final Result
51 |
hmac_sha256(client_seed:nonce, server_seed)
52 | 53 |
54 |
55 | 56 | 110 | -------------------------------------------------------------------------------- /lottery.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Lottery verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 105 | 106 | -------------------------------------------------------------------------------- /mines.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Mines verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |

Mines verify

18 |
19 |
20 |

Input

21 |
22 | 28 |
29 |
30 | 36 |
37 |
38 | 44 |
45 |
46 |
47 |
48 |

Output

49 |
50 | 51 | 52 |
53 |
54 | 55 | 56 |
57 |
58 |
59 |
60 |

Final Result

61 | {{ resultList }} 62 |
63 |
64 | 65 | 142 | -------------------------------------------------------------------------------- /oriental-beauties.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Oriental Beauties verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |

oriental beauties verify

20 |
21 |
22 |

Input

23 |
24 | 25 |
26 |
27 | 28 |
29 |
30 | 31 |
32 |
33 | 34 |
35 |
36 |
37 |
38 |

Output

39 |
40 | 41 | 42 |
43 |
44 | 45 | 46 |
47 |
48 |
49 |
50 |

Bytes

51 |
Final Result
52 |
hmac_sha256(client_seed:nonce:round, server_seed)
53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 |
{{ item }}
{{ item }}
64 |
65 |
Bytes to Number
66 |
67 | ({{results.hex[0] + ', ' + results.hex[1] + ', ' + results.hex[2] + ', ' + results.hex[3]}}) -> [0, ... 80] = {{Math.floor(numResult * 100.01) / 100}} 68 |
       {{Number(results.hex[0] / 256).toFixed(9)}}    ({{results.hex[0]}} / (256 ^ 1))
69 |
+    {{Number(results.hex[1] / (256 * 256)).toFixed(9)}}    ({{results.hex[1]}} / (256 ^ 2))
70 |
+    {{Number(results.hex[2] / (256 * 256 * 256)).toFixed(9)}}    ({{results.hex[2]}} / (256 ^ 3))
71 |
+    {{Number(results.hex[3] / (256 * 256 * 256 * 256)).toFixed(9)}}    ({{results.hex[3]}} / (256 ^ 4))
72 |
=    {{numResult}}
73 |
74 |
75 |
76 |

Bouns

77 |
78 | 79 | 80 |
81 |
82 | 83 | 84 |
85 |
86 |
87 |

Bytes

88 |
89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 |
{{ item }}
{{ item }}
99 |
100 |
101 |
102 |

Bonus table

103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 119 | 120 | 123 | 126 | 127 | 128 |
IndexPayoutWeightsRange
{{item[0]}} 117 | {{item[1]}} 118 | {{item[2]}} 121 | {{item[3]}},{{item[4]}}) 122 | 124 |
Bingo
125 |
129 |
130 |
131 | 132 | 238 | -------------------------------------------------------------------------------- /parity.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Parity - Game Verification Script 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 49 | 74 | 75 | 76 | 77 |
78 |
79 |

Parity - Game Verification Script

80 |

Third party script used to verify games on Parity game.

81 |
82 |
83 |
84 |

The following sites have purchased a non-distributable copy of the previous version of betco source code, exempting them from the requirements of the AGPL:

85 |

https://bet.co/

86 |
87 |
88 | 92 | 93 |
94 |
95 | 96 |

97 | 98 | 99 |

100 |
101 |
102 | 103 |

104 | 105 | 106 |

107 |
108 |
109 | 110 |

111 | 112 | 113 |

114 |
115 |
116 |

117 | Verify 118 |

119 |
120 |
121 |
122 |
123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 |
Game's hashResult
132 |
133 |
134 | 217 | 226 | 227 | 228 | 229 | -------------------------------------------------------------------------------- /patti.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Patti verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 30 | 31 | 32 |
33 |

Patti verify

34 |
35 |
36 |

Input

37 |
38 | 39 | 44 |
45 |
46 | 47 | 48 |
49 |
50 | 51 | 56 |
57 |
58 |
59 |
60 |

Results

61 |
62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 87 | 101 | 102 | 103 |
Game's hashPlayerAPlayerB
{{ item.hash }} 74 |
75 |
80 |
81 |
{{ card.suits }}
82 |
{{ card.point }}
83 |
84 |
85 |
86 |
88 |
89 |
94 |
95 |
{{ card.suits }}
96 |
{{ card.point }}
97 |
98 |
99 |
100 |
104 |
105 |
106 |
107 | 108 | 280 | 281 | 282 | -------------------------------------------------------------------------------- /plinko.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Plinko verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |

Plinko verify

18 |
19 |
20 |

Input

21 |
22 | 23 |
24 |
25 | 26 |
27 |
28 | 29 |
30 |
31 |
32 |
33 |

Output

34 |
35 | 36 | 37 |
38 | 39 |
40 | 41 | 42 |
43 | 44 |
45 |
Convert each set of four bytes into a number
46 |
47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 |
#{{ index }}
Hex{{ hex }}
Base 10{{ parseInt(hex) }}
65 |
66 |
67 |
Each set of 4 bytes is turned into a number in the range [0, 1). Only the first calculation is displayed for conciceness.
68 |
({{ parseInt(result_hash_list[0]) }}/256^1) + ({{ parseInt(result_hash_list[1]) }}/256^2) + ({{ parseInt(result_hash_list[2]) }}/256^3) + ({{ parseInt(result_hash_list[3]) }}/256^4)
69 |
= ({{ parseInt(result_hash_list[0])/(256) }}) + ({{ parseInt(result_hash_list[1])/(256*256) }}) + ({{ parseInt(result_hash_list[2])/(256*256*256) }}) + ({{ parseInt(result_hash_list[0])/(256*256*256*256) }})
70 |
= ({{ parseInt(result_hash_list[0])/(256) + parseInt(result_hash_list[1])/(256*256) + parseInt(result_hash_list[2])/(256*256*256) + parseInt(result_hash_list[3])/(256*256*256*256) }})
71 |
72 |
73 |

Results

74 |
75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 |
Pin #NumberNumber*2Direction
{{ index+1 }}{{ num }}{{ num*2 }}{{ num>.5?'Right':'Left' }}
93 |
94 |
95 |
96 | 148 | 149 | -------------------------------------------------------------------------------- /ringOfFortune.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Ring of fortune verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

Ring of fortune verify

19 |
20 |
21 |

Input

22 |
23 | 24 |
25 |
26 | 27 |
28 |
29 | 30 |
31 |
32 | 33 |
34 |
35 |
36 |
37 |

Output

38 |
39 | 40 | 41 |
42 |
43 | 44 | 45 |
46 |
47 |
48 |
49 |

Results

50 |
Final Result
51 |
hmac_sha256(client_seed:nonce, server_seed)
52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
{{ item }}
{{ item }}
63 |
64 |
Bytes to Number
65 |
66 | ({{results.hex[0] + ', ' + results.hex[1] + ', ' + results.hex[2] + ', ' + results.hex[3]}}) -> [0, ... 4] = {{Math.floor(numResult * 1000)}} 67 |
       {{Number(results.hex[0] / 256).toFixed(9)}}    ({{results.hex[0]}} / (256 ^ 1))
68 |
+    {{Number(results.hex[1] / (256 * 256)).toFixed(9)}}    ({{results.hex[1]}} / (256 ^ 2))
69 |
+    {{Number(results.hex[2] / (256 * 256 * 256)).toFixed(9)}}    ({{results.hex[2]}} / (256 ^ 3))
70 |
+    {{Number(results.hex[3] / (256 * 256 * 256 * 256)).toFixed(9)}}    ({{results.hex[3]}} / (256 ^ 4))
71 |
=    {{numResult}}     (* 1000)
72 |
=    {{Number(numResult * 1000).toFixed(9)}}
73 |
74 |
75 |
0~495 = 2x
76 |
496~825 = 3x
77 |
826~990 = 6x
78 |
991~1000 = 99x
79 |
80 |
81 |
82 | 83 | 148 | -------------------------------------------------------------------------------- /ringOfFortune_new.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Ring of fortune verify 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 |

Ring of fortune verify

22 |
23 |
24 |

Input

25 |
26 | 28 |
29 |
30 | 32 |
33 |
34 | 36 |
37 |
38 | 39 |
40 |
41 |
42 |
43 |

Output

44 |
45 | 46 | 47 |
48 |
49 | 50 | 51 |
52 |
53 |
54 |
55 | 56 |

Results

57 |
Final Result
58 | 59 |
Calculation Process
60 |

Using the formula `hmac_sha256(client_seed:nonce, server_seed)`,

61 |

We get the hash result:

62 |

`{{result_hash}}`.

63 |
64 |
    65 |
  1. Take the first 15 characters, resulting in `{{baseHash}}`.
  2. 66 |
  3. Convert this to decimal, which gives: `{{BigInt('0x' + baseHash)}}`.
  4. 67 |
  5. Perform modulus 47(47 is fixed constant), and we get a remainder of {{index}}.
  6. 68 |
  7. Starting from the index, take 14 characters, resulting in `{{newHash}}`. 69 |
  8. 70 |
  9. Convert this to decimal, resulting in: `{{BigInt('0x' + newHash)}}`.
  10. 71 |
  11. Divide by 8(8 is a fixed constant), resulting in: `{{BigInt('0x' + newHash) / BigInt(8)}}`.
  12. 72 |
  13. Multiply by 2^-53(2^-53 is a fixed constant), resulting in: `{{Number(BigInt('0x' + newHash) / 73 | BigInt(8)) * Math.pow(2, -53)}}`.
  14. 74 |
  15. Finally, Multiply by 1000(1000 is a fixed constant), resulting in: `{{Number(BigInt('0x' + newHash) / 75 | BigInt(8)) * Math.pow(2, -53) * 1000}}`.
  16. 76 |
77 |
78 |
79 |
0~495 = {{range1}}
80 |
496~825 = {{range2}}
81 |
826~990 = {{range3}}
82 |
991~1000 = {{range4}}
83 |
84 | 85 | 86 | 87 | 160 | 161 | -------------------------------------------------------------------------------- /roulette.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Roulette - Game Verification Script 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 49 | 74 | 75 | 76 | 77 |
78 |
79 |

Roulette - Game Verification Script

80 |

Third party script used to verify games on roulette game.

81 |
82 |
83 |
84 |
85 |

86 | 87 | 88 |

89 |
90 |
91 |

92 | 93 | 94 |

95 |
96 |
97 |

98 | Verify 99 |

100 |
101 |
102 |
103 |
104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 |
Game's hashResult
113 |
114 |
115 | 207 | 216 | 217 | 218 | -------------------------------------------------------------------------------- /roulettesingle.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Roulette Single Verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 136 | 137 | -------------------------------------------------------------------------------- /roulettesingle_new.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Roulette Single Verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 117 | 118 | -------------------------------------------------------------------------------- /saviourSword.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bcgame-project/verify/5af2cd9461d17bc538fcf529a33db98e2df607b9/saviourSword.pdf -------------------------------------------------------------------------------- /sicbo-multiplayer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Sicbo Verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 23 | 24 | 25 |
26 |

Sicbo Verify

27 |
28 |
29 |

Input

30 |
31 | 32 | 37 |
38 |
39 | 40 | 41 |
42 |
43 | 44 | 49 |
50 |
51 |
52 |
53 |

Results

54 |
55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 |
Game's hashDice 1Dice 2Dice 3Total SumResult Array
{{ item.hash }}{{ item.diceResults[0] }}{{ item.diceResults[1] }}{{ item.diceResults[2] }}{{ item.totalSum }}[{{ item.diceResults.join(', ') }}]
77 |
78 |
79 |
80 | 81 | 140 | 141 | 142 | -------------------------------------------------------------------------------- /stellar_rush.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Stellar Rush verify 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |

Stellar Rush verify

20 |
21 |
22 |

Input

23 |
24 | 26 |
27 |
28 | 30 |
31 |
32 | 33 |
34 |
35 |
36 |
37 |

Output

38 |
39 | 40 | 42 |
43 |
44 | 45 | 46 |
47 |
48 |
49 |
50 |

Final Result

51 | {{ resultList }} 52 |
53 |
54 | 55 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /sword.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Sword verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

Sword verify

19 |
20 |
21 |

Input

22 |
23 | 24 |
25 |
26 | 27 |
28 | 31 |
32 | 33 |
34 |
35 | 36 |
37 |
38 |
39 |
40 |

Output

41 |
42 | 43 | 44 |
45 |
46 | 47 | 48 |
49 |
50 |
51 |
52 |

Bytes

53 |
Final Result
54 |
hmac_sha256(client_seed:nonce:round, server_seed)
55 |
56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 |
{{ item }}
{{ item }}
66 |
67 |
Bytes to Number
68 |
69 | ({{results.hex[0] + ', ' + results.hex[1] + ', ' + results.hex[2] + ', ' + results.hex[3]}}) -> [0, ... 4] = {{Math.floor(numResult * 100.01 * 100) / 100}} 70 |
       {{Number(results.hex[0] / 256).toFixed(9)}}    ({{results.hex[0]}} / (256 ^ 1))
71 |
+    {{Number(results.hex[1] / (256 * 256)).toFixed(9)}}    ({{results.hex[1]}} / (256 ^ 2))
72 |
+    {{Number(results.hex[2] / (256 * 256 * 256)).toFixed(9)}}    ({{results.hex[2]}} / (256 ^ 3))
73 |
+    {{Number(results.hex[3] / (256 * 256 * 256 * 256)).toFixed(9)}}    ({{results.hex[3]}} / (256 ^ 4))
74 |
=    {{numResult}}
75 |
76 |
77 |

78 | Please check the following documents for verification method and 79 | comparison table 80 |

81 |

82 | 87 | SaviourSword.pdf 88 | 89 |

90 |
91 | 92 | 158 | -------------------------------------------------------------------------------- /tower.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | Tower Verify 8 | 9 | 10 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 |
80 | 227 | 228 | 229 | -------------------------------------------------------------------------------- /ultimatedice.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | UltimateDice verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |

UltimateDice verify

19 |
20 |
21 |

Input

22 |
23 | 24 |
25 |
26 | 27 |
28 |
29 | 30 |
31 |
32 | 33 |
34 |
35 |
36 |
37 |

Output

38 |
39 | 40 | 41 |
42 |
43 | 44 | 45 |
46 |
47 |
48 |
49 |

Results

50 |
Final Result
51 |
hmac_sha256(client_seed:nonce, server_seed)
52 |
53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 |
{{ item }}
{{ item }}
63 |
64 |
Bytes to Number
65 |
66 | ({{results.hex[0] + ', ' + results.hex[1] + ', ' + results.hex[2] + ', ' + results.hex[3]}}) -> [0, ... 4] = {{Math.floor(numResult * 10000)}} 67 |
       {{Number(results.hex[0] / 256).toFixed(9)}}    ({{results.hex[0]}} / (256 ^ 1))
68 |
+    {{Number(results.hex[1] / (256 * 256)).toFixed(9)}}    ({{results.hex[1]}} / (256 ^ 2))
69 |
+    {{Number(results.hex[2] / (256 * 256 * 256)).toFixed(9)}}    ({{results.hex[2]}} / (256 ^ 3))
70 |
+    {{Number(results.hex[3] / (256 * 256 * 256 * 256)).toFixed(9)}}    ({{results.hex[3]}} / (256 ^ 4))
71 |
=    {{(numResult * 10000).toFixed(6)}}     (* 10000)
72 |
=    {{Math.floor(numResult * 10000)}}
73 |
74 |
75 |
76 | 77 | 142 | -------------------------------------------------------------------------------- /ultimatedice_new.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | UltimateDice verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |

UltimateDice verify

20 |
21 |
22 |

Input

23 |
24 | 25 |
26 |
27 | 28 |
29 |
30 | 31 |
32 |
33 | 34 |
35 |
36 |
37 |
38 |

Output

39 |
40 | 41 | 42 |
43 |
44 | 45 | 46 |
47 |
48 |
49 |
50 |

Results

51 |
Final Result
52 | 53 |
Calculation Process
54 |

Using the formula `hmac_sha256(client_seed:nonce, server_seed)`,

55 |

We get the hash result:

56 |

`{{result_hash}}`.

57 |
58 |
    59 |
  1. Take the first 15 characters, resulting in `{{baseHash}}`.
  2. 60 |
  3. Convert this to decimal, which gives: `{{BigInt('0x' + baseHash)}}`.
  4. 61 |
  5. Perform modulus 47(47 is fixed constant), and we get a remainder of {{index}}.
  6. 62 |
  7. Starting from the index, take 14 characters, resulting in `{{newHash}}`.
  8. 63 |
  9. Convert this to decimal, resulting in: `{{BigInt('0x' + newHash)}}`.
  10. 64 |
  11. Divide by 8(8 is a fixed constant), resulting in: `{{BigInt('0x' + newHash) / BigInt(8)}}`.
  12. 65 |
  13. Multiply by 2^-53(2^-53 is a fixed constant), resulting in: `{{Number(BigInt('0x' + newHash) / BigInt(8)) * Math.pow(2, -53)}}`.
  14. 66 |
  15. Multiply by 10000(10000 is a fixed constant), resulting in: `{{Number(BigInt('0x' + newHash) / BigInt(8)) * Math.pow(2, -53) * 10000}}`.
  16. 67 |
  17. Finally, take the integer part of the result, which gives: `{{numResult}}`.
  18. 68 |
69 |
70 |
71 |
72 | 73 | 128 | 129 | -------------------------------------------------------------------------------- /videopoker.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | VideoPoker Verify 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 |

VideoPoker Verify

18 |
19 |
20 |

Input

21 |
22 | 23 |
24 |
25 | 26 |
27 |
28 | 29 |
30 |
31 | 32 |
33 |
34 |
35 |
36 |

Output

37 |
38 | 39 | 40 |
41 |
42 | 43 | 44 |
45 |
46 |
47 |
48 |

Results

49 |
50 |
51 |
52 |
53 |
{{cardFlower(item.card)}}
54 |
{{cardPoint(item.card)}}
55 |
56 |
57 |
58 |
59 |
60 |
61 | 62 | 166 | --------------------------------------------------------------------------------