String value = "0001111000010000000100000100100110000000000000101010000101000000011000000010011110011001001101100011101011110110000100001101010111010011101010011001011001100001001000010000000010110001001001001011"
BigInteger bi = new BigInteger(value, 2);
// bi : 11794183182202048648710358761397377436458666044077659329099
byte[] bytes = bi.toByteArray();
// bytes : [B@647aa62
I have Java code like above. Trying to convert this to Swift.
I wonder how to do the above conversion to get the same result in Swift.
I know it's okay to use 'BigInteger' as 'Int' in Swift.
Int(value,radix: 2)!
I found 'Int(value,radix: 2)!' in Swift. But this didn't work.(I got nil as result. )
What method should I use to get the same result as above java in Swift? And what additional information do I need to get to do this?