(Note: I'm using http://www.royalforkblog.com/2014/08/11/graphical-address-generator/ (use "bitcoin" as the phrase for generating the private key)
I'm trying to take the first step in going from a publickey to an address.
For example, if this is my public key:
publickey = 02218AD6CDC632E7AE7D04472374311CEBBBBF0AB540D2D08C3400BB844C654231
This should be the result of the next step:
ripemd160(sha256(publickey)) = 5238C71458E464D9FF90299ABCA4A1D7B9CB76AB
However, when I try to do this in python, I fail to get the same result:
>>> hashlib.new('sha256', '02218AD6CDC632E7AE7D04472374311CEBBBBF0AB540D2D08C3400BB844C654231').hexdigest()
'6e28eefe40e5855ed8cdf0599ec12e52f73a5b222c84ba957b4dcdd2d8a9cf2a'
>>> hashlib.new('ripemd160', '6e28eefe40e5855ed8cdf0599ec12e52f73a5b222c84ba957b4dcdd2d8a9cf2a').hexdigest()
'e607ff4fa71ef33ca357415e3d2f781c4cedacc3'
Where am I going wrong when using sha256 and ripemd160 in my python code?