<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=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Dec 1, 2017, at 11:05 AM, Erica Sadun via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a>&gt; 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? &nbsp;</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></body></html>