#include <glib.h>
Go to the source code of this file.
Functions | |
gboolean | urn_get_http_sha1 (const gchar *buf, gchar *retval) |
Validate SHA1 starting in NUL-terminated `buf' as a proper base32 encoding of a SHA1 hash, and write decoded value in `retval'. | |
gboolean | urn_get_sha1 (const gchar *buf, gchar *digest) |
Locate the start of "urn:sha1:" or "urn:bitprint:" indications and extract the SHA1 out of it, placing it in the supplied `digest' buffer. | |
gboolean | urn_get_sha1_no_prefix (const gchar *buf, gchar *digest) |
This is the same as urn_get_sha1(), only the leading "urn:" part is missing (typically a URN embedded in a GGEP "u"). |
|
Validate SHA1 starting in NUL-terminated `buf' as a proper base32 encoding of a SHA1 hash, and write decoded value in `retval'. The SHA1 typically comes from HTTP, in a X-Gnutella-Content-URN header. Therefore, we unconditionally accept both old and new encodings.
|
|
Locate the start of "urn:sha1:" or "urn:bitprint:" indications and extract the SHA1 out of it, placing it in the supplied `digest' buffer.
|
|
This is the same as urn_get_sha1(), only the leading "urn:" part is missing (typically a URN embedded in a GGEP "u"). `buf' MUST start with "sha1:" or "bitprint:" indications. Since the leading "urn:" part is missing, we cannot be lenient. Extract the SHA1 out of it, placing it in the supplied `digest' buffer.
|