[tor-bugs] #6708 [Onionoo]: Pyonionoo returns code 500 for a few parameters
Tor Bug Tracker & Wiki
torproject-admin at torproject.org
Sun Sep 23 15:50:48 UTC 2012
#6708: Pyonionoo returns code 500 for a few parameters
---------------------+------------------------------------------------------
Reporter: karsten | Owner: gsathya
Type: defect | Status: needs_review
Priority: normal | Milestone:
Component: Onionoo | Version:
Keywords: | Parent:
Points: | Actualpoints:
---------------------+------------------------------------------------------
Comment(by karsten):
Replying to [comment:5 gsathya]:
> Please review my
[https://github.com/gsathya/pyonionoo/compare/bug_6708_revised
bug_6708_revised] branch. Thanks!
Will try to have a look today.
> Haven't added support for hashed fingerprint. Is this [...]
It's neither of the two. The "f204" part is hex-encoded, not
base64-encoded. A hashed fingerprint as produced by metrics-db uses the
binary fingerprint as input, so you'll first have to decode that hex
value. Then you apply sha1 and encode the result in hex. In Python,
that's:
{{{
>>> from binascii import a2b_hex
>>> from hashlib import sha1
>>> sha1(a2b_hex("f2044413dac2e02e3d6bcf4735a19bca1de97281")).hexdigest()
'16ef359c2fbf50fc08cf9a95717be3060575b67e'
}}}
--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/6708#comment:7>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
More information about the tor-bugs
mailing list