title: Randomisation Services iOS (Random bytes conversion to NSString)
body: <p>I am trying to generate a random bytes received from the <code>SecRandomCopyBytes</code> to a Random String.</p>
  
  <pre><code>uint8_t resultBytes[10];
  SecRandomCopyBytes(kSecRandomDefault, 10, resultBytes);
  </code></pre>
  
  <p>The resultBytes is shown below.</p>
  
  <pre><code>    (uint8_t [10]) resultBytes = ([0] = '\xf5', [1] = '[', [2] =
   '\x0e', [3] = '\xb0', [4] = '\xaf', [5] = '|', 
  [6] = '\x13', [7] = '\xfb', [8] = 'r', [9] = '\xb8')
  </code></pre>
  
  <p>If I convert to NSString with ASCII encoding it works but does not work with UTF encoding.</p>
  
  <pre><code>NSLog(@"Random Number Results=&lt;%@&gt;",[[NSString alloc] initWithBytes:resultBytes length:10 encoding:NSASCIIStringEncoding]);
  </code></pre>
  
  <p><strong><code>Number Results =&lt;õ[°¯|ûr¸&gt;</code></strong></p>
  
  <p>Is the output string correct or I am doing something wrong?</p>