#include "common.h"
#include "base32.h"
#include "misc.h"
#include "urn.h"
#include "override.h"
Functions | |
RCSID ("$Id:urn.c, v 1.9 2005/06/25 01:37:43 daichik Exp $") | |
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.
|