Let's say I have an object, called myMD5
, like this:
<md5 HASH object @ 0xb79b9860>
And here is dir(myMD5)
:
['__class__', '__delattr__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'block_size', 'copy', 'digest', 'digest_size', 'digestsize', 'hexdigest', 'name', 'update']
I want to get the hash string, and to do that I need to call myMD5.hexdigest()
.
The problem is that I'm actually making a challenge (called PyJail) and the use of the character dot (.
) is forbidden.
So, I need to call this method by another way. Is there any way to call it like a function ? Something like this:
hexdigest(myMD5)
I tried to do this, but it does not work:
getattr(myMD5, dir(myMD5)[-3]) # returns <classmethod object at 0xb79b998c>
PS; Other elements are also forbidden by the challenge, like using quotes ('
, "
), using import
statements, using things like exec
or eval
, etc.