News for hackers. Stuff that matters.
Re:Show HN: Deck of Cards – A playing card API by soup10 on Monday May 11, 2015 @02:27AM (#9523043)
I like the website design but shuffling cards is extremely trivial to code. Also cards are mostly used for gambling games and it's a huge security hole to use a third party api for that unless it's from a very trustworthy source.

One maybe useful thing about this api is the card images, but there are also probably plenty of decks in the public domain.

Re:Show HN: Deck of Cards – A playing card API by nly on Monday May 11, 2015 @06:08AM (#9523616)
> Also cards are mostly used for gambling games and it's a huge security hole to use a third party api

Depends. If you're writing a game you wanted the player to trust you might want to use an external shuffling service so you can easily show proof-of-deck after the game is over.

Of course, you could do this simply by giving the player a cryptographic hash of the shuffled deck beforehand, e.g. SHA-256(5H,4D,AS...)

Re:Show HN: Deck of Cards – A playing card API by ivanche on Monday May 11, 2015 @07:37AM (#9523917)
I've worked as a developer for online gambling games for 6 years. We never shuffled the deck of cards. Instead, as player requests another card(s), they are generated using hardware RNG and returned to player. Deck only knows which cards are left in it, but their order is undefined until that call to RNG.
Re:Show HN: Deck of Cards – A playing card API by sesquipedalian on Monday May 11, 2015 @11:19AM (#9525384)
If I'm not mistaken, this sounds like an incremental fisher-yates shuffle.
Re:Show HN: Deck of Cards – A playing card API by ivanche on Monday May 11, 2015 @12:46PM (#9526061)
You are correct. As the matter of fact, a bunch of games in majority of cases needed only the next card from the deck, that's why in our heads we almost always thought of "not shuffling at all".
Re:Show HN: Deck of Cards – A playing card API by g8gggu89 on Monday May 11, 2015 @11:37AM (#9525510)
How is that better? You just don't want to spend the time to shuffle a deck if only a few cards will be used? Or you are worried someone might cheat by being able to read card order ahead of time?