5 ms·
You can use one deck to encode 225 bits of information.
by nabla9 2y ago
You can use one deck to encode 225 bits of information.
- pesfandiar 2y ago277 if we encode information in whether each card is face up or down
- RedNifre 2y agoNot quite, because you won't be able to tell the deck orientation any more.
- whartung 2y agoSo, then 275? With the both the top and bottom card face down? That's going in my next spy novel. Spy 1 gets together with Spy 2, for cracking game of Cribbage, and at the end, Spy 2 walks out with a deck of cards, but it's actually a 256 bit encryption key.
- praptak 2y agoSome cards are not symmetrical, (e.g. any seven or a five of not-diamonds) so they can encode two bits of information.
- RedNifre 2y agoYeah, I actually implemented this some years ago here, for UTF-8 text: https://github.com/Michael-Zinn/cardfs https://github.com/Michael-Zinn/cardfs Works for Poker, Skat, Tarot and Quartett decks.
- zzo38computer 2y agoA tarot deck has more than only trumps. It also has fourteen non-trumps in each of four suits (Latin-suited or French-suited depending on the deck), so the total number of cards (trumps and non-trumps) is 78. Furthermore, if you can store bytes, then why should it need to be UTF-8? Not all data is text, and not all text is Unicode (and not all Unicode text is most efficient with UTF-8). As far as I can tell, the only part of the program that requires it to be UTF-8 is the "decode_array_to_string" function (although I think it will have to be a string without embedded null characters since that is how argv is working, and that could possibly allow you to store a few more bytes, if the data is required to not have null characters).
- RedNifre 2y agoThanks for pointing this out, I did not know that there are other tarot decks (I only have this one https://steemit.com/software/@michaelzinn/store-text-in-a-deck-of-cards https://steemit.com/software/@michaelzinn/store-text-in-a-de... ) I originally had planned to store other data as well (that's why it's called "CardFS"): With the bytes, there is another multiplier 3 in there, which is unused. My plan was to do 0=UTF-8 text, 1=raw bytes, 2=bitmap graphic, but I stopped working on it after I got the UTF-8 text working. Excluding NUL characters would only up the byte count to floor(log_255(52!)), which is still 28 bytes (though it increases the unused multiplier from 2.99 to 3.1, which makes it possible to use all bytes in all three file types), but how would you then store texts that use fewer than the maximum number of characters? Fill it with spaces?