       uLength     = Math.ceil(binary.length/8)
       unsignedInt = new Uint8Array(uLength)
       for i in [0..uLength]
-        uint8          = binary.slice(i*8, i*8 + 7)
-        unsignedInt[i] = Number.parseInt(uint8, 2)
+        uint8          = binary.subarray(i*8, i*8 + 7)
+        unsignedInt[i] = parseInt(uint8, 2) # Note: this shit is broken. Should probably hard-code constants.
       return unsignedInt
 
   return RsaKeyGenerator

          return keyPair
        )

    # Forge
    

    # Generate public and private RSA keys

        window.crypto.subtle.generateKey( {
          name: 'RSA-OAEP'
          modulusLength: params.bits
          publicExponent: new Uint8Array([1,0,1]) # constants
          hash: { name: 'SHA-256' }
        }, true, ['encrypt', 'decrypt'])
      .then (keys) ->
