MCPcopy Create free account
hub / github.com/davidaurelio/hashids-python / decode_hex

Method decode_hex

hashids.py:265–273  ·  view source on GitHub ↗

Restores a hexadecimal string (e.g. a MongoDB id) from a hashid. :param hashid The hashid to decode >>> Hashids.decode_hex('y42LW46J9luq3Xq9XMly') '507f1f77bcf86cd799439011'

(self, hashid)

Source from the content-addressed store, hash-verified

263 return ''
264
265 def decode_hex(self, hashid):
266 """Restores a hexadecimal string (e.g. a MongoDB id) from a hashid.
267
268 :param hashid The hashid to decode
269
270 >>> Hashids.decode_hex('y42LW46J9luq3Xq9XMly')
271 '507f1f77bcf86cd799439011'
272 """
273 return ''.join(('%x' % x)[1:] for x in self.decode(hashid))

Callers 2

test_decode_hexMethod · 0.95

Calls 1

decodeMethod · 0.95

Tested by 2

test_decode_hexMethod · 0.76