OK, I have managed to get the number, however I've no idea why it behaves this way:
Step 1. Get binary representation of the string:
shared_key.unpack('B*').first
Step 2. Convert this into integer:
shared_key.unpack('B*').first.to_i(2)
#=> 95320918630576230557892713337132753026878147296634144208600768328265758846190