title: How to generate random long hexadecimal in Swift?
body: <p>I am trying to generate a random 6 bytes long hex but I ma having problems. the error I am getting is: &quot;Integer literal overflows when stored into 'UInt32'&quot;.</p>
  <p>Here is my code:</p>
  <pre><code>var baseInt = UInt64(arc4random() % 281474976710655)
  var str = String(format: &quot;%06X&quot;, baseInt)
  println(&quot;\(str)&quot;)
  </code></pre>
  <p>Any help?</p>