<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">On Dec 1, 2017, at 11:23 PM, David Waite <<a href="mailto:david@alkaline-solutions.com" class="">david@alkaline-solutions.com</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On Dec 1, 2017, at 11:05 AM, Erica Sadun via swift-evolution <<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I'd like to put forth that Gameplay Kit offers a perfectly cromulent model of random number generation and API. Why not take that as a starting point, Swiftify it so it becomes a cross platform solution, and then apply the specific questions of sequences, collections, and indices as a second step? </div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br class=""></div><div style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">I don't support intermingling random functionality with existing core types.</div><br class="Apple-interchange-newline"></div></blockquote></div><br class=""><div class="">GameplayKit randomization has a number of API deficiencies that we can’t easily/efficiently solve by wrapping it in Swift.</div><div class=""><br class=""></div><div class="">Most significantly, it is not designed to support any cryptographic operations (which I believe is why they never added a nextBytes() or equivalent method).</div><div class=""><br class=""></div><div class="">For GameplayKit this is fine - the design focuses on being able to get the distribution appropriate for your game, and being able to have identical pseudorandom number sequences for each device in a multiplayer scenario. They went as far as to require all random sources to support NSSecureCoding so that they may be persisted and/or serialized over the wire, which precludes a GKRandomSource from being based on the system random sources.</div><div class=""><br class=""></div><div class="">-DW</div></div></div></blockquote></div><br class=""><div class="">I wasn't suggesting wrapping as that would not provide a cross platform solution. Instead of re-inventing the wheel, we may profit from the approaches already explored and real-world tested in prior art and existing standards.</div><div class=""><br class=""></div><div class="">-- E</div><div class=""><br class=""></div></body></html>