title: Convert NSString to binary string
body: <p>I have a NSString representing sha1 hash of some data and I need to convert it to binary string, but cant find any good solution to do that. It should be equivalent to PHP's pack function.</p>
  
  <p>The result should be like this: 0xb7, 0xc7, 0x91, ..., 0x90.</p>
  
  <p>I than need to convert this binary to base64-encoded string. </p>