Online PlayTable Security Code Calculation
EDIT:
forgot to mention that
-the amount of "cardname" is also a factor
-the final string is actually the base64 string representation of the md5 hash, because the hash is just an array of bytes.
also changed step 1 with 2, because getting rid of basic land is pretty much the thing to do first.
In case you would need to calculate this for yourself, here is how to do that.
Take the deck:
2 Aa2
3 Plains
1 Ee3
5 Swamp
2 dD!
1 bB?
SB: 3 C_c
1.) remove all basic land
2 Aa2
1 Ee3
2 dD!
1 bB?
SB: 3 C_c
2.) Merge sideboard and maindeck into one list. Keep in mind that when you have more than 1 of a given card, say N, you need to have that card N times in this list (or you can do this when you do step 6)
Aa2
Aa2
Ee3
dD!
dD!
bB?
C_c
C_c
C_c
3.) convert all cardsnames to uppercase
AA2
AA2
EE3
DD!
DD!
BB?
C_C
C_C
C_C
4.) strip from all cardnames all characters besides 'A'..'Z'
AA
AA
EE
DD
DD
BB
CC
CC
CC
5.) sort this list of cardsnames (culture doesn't matter, because it's A..Z only)
AA
AA
BB
CC
CC
CC
DD
DD
EE
6.) concatenate all cardnames into one string
AAAABBCCCCCCDDDDEE
7.) take the MD5 hash of this string
some array of bytes
8.) convert this array of bytes to it's base64 representation
some string consisting of a..z, A..Z, 0..9, +, / and = as the filler character
9.) take the first 10 characters of this hash value.
Done!
Note:
This method means that sideboarding does not change the code.
This also means that one could potentially sideboard before game 1 of a match if one would want to cheat and one would have knowledge of the deck his/her opponent is playing and knows how to get an unfair advantage.
However, I have chosen this method because of
a.) the code doesn't change
b.) post game1 sideboarding is much more important than pre game1 "cheating"
Also keep in mind that these codes will eventually become obsolete when the server takes care of the decks for the players and players actually need to do the sideboarding on the server (there may be an offline->board->connect->submit feature in there somewhere). This way pre game1 sideboarding and other illegal deck manipulation will become impossible and checks made by players will no longer be needed so they can just focus on the actual game.
Thanks for reading!
Jorbes.
forgot to mention that
-the amount of "cardname" is also a factor
-the final string is actually the base64 string representation of the md5 hash, because the hash is just an array of bytes.
also changed step 1 with 2, because getting rid of basic land is pretty much the thing to do first.
In case you would need to calculate this for yourself, here is how to do that.
Take the deck:
2 Aa2
3 Plains
1 Ee3
5 Swamp
2 dD!
1 bB?
SB: 3 C_c
1.) remove all basic land
2 Aa2
1 Ee3
2 dD!
1 bB?
SB: 3 C_c
2.) Merge sideboard and maindeck into one list. Keep in mind that when you have more than 1 of a given card, say N, you need to have that card N times in this list (or you can do this when you do step 6)
Aa2
Aa2
Ee3
dD!
dD!
bB?
C_c
C_c
C_c
3.) convert all cardsnames to uppercase
AA2
AA2
EE3
DD!
DD!
BB?
C_C
C_C
C_C
4.) strip from all cardnames all characters besides 'A'..'Z'
AA
AA
EE
DD
DD
BB
CC
CC
CC
5.) sort this list of cardsnames (culture doesn't matter, because it's A..Z only)
AA
AA
BB
CC
CC
CC
DD
DD
EE
6.) concatenate all cardnames into one string
AAAABBCCCCCCDDDDEE
7.) take the MD5 hash of this string
some array of bytes
8.) convert this array of bytes to it's base64 representation
some string consisting of a..z, A..Z, 0..9, +, / and = as the filler character
9.) take the first 10 characters of this hash value.
Done!
Note:
This method means that sideboarding does not change the code.
This also means that one could potentially sideboard before game 1 of a match if one would want to cheat and one would have knowledge of the deck his/her opponent is playing and knows how to get an unfair advantage.
However, I have chosen this method because of
a.) the code doesn't change
b.) post game1 sideboarding is much more important than pre game1 "cheating"
Also keep in mind that these codes will eventually become obsolete when the server takes care of the decks for the players and players actually need to do the sideboarding on the server (there may be an offline->board->connect->submit feature in there somewhere). This way pre game1 sideboarding and other illegal deck manipulation will become impossible and checks made by players will no longer be needed so they can just focus on the actual game.
Thanks for reading!
Jorbes.