/** * librdf_uri_get_digest: * @uri: #librdf_uri object * * Get a digest for the URI. * * Generates a digest object for the URI. The digest factory used is * determined at class initialisation time by librdf_init_uri(). * * Return value: new #librdf_digest object or NULL on failure. **/ librdf_digest* librdf_uri_get_digest(librdf_uri* uri) { librdf_world *world=uri->world; librdf_digest* d; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, NULL); d=librdf_new_digest_from_factory(world, world->digest_factory); if(!d) return NULL; librdf_digest_update(d, (unsigned char*)uri->string, uri->string_length); librdf_digest_final(d); return d; }
/** * librdf_uri_get_digest: * @world: #librdf_world object * @uri: #librdf_uri object * * Get a digest for the URI. * * Generates a digest object for the URI. The digest factory used is * determined at class initialisation time by librdf_init_uri(). * * Return value: new #librdf_digest object or NULL on failure. **/ librdf_digest* librdf_uri_get_digest(librdf_world* world, librdf_uri* uri) { librdf_digest* d; unsigned char *str; size_t len; LIBRDF_ASSERT_OBJECT_POINTER_RETURN_VALUE(uri, librdf_uri, NULL); d = librdf_new_digest_from_factory(world, world->digest_factory); if(!d) return NULL; str = librdf_uri_as_counted_string(uri, &len); librdf_digest_update(d, str, len); librdf_digest_final(d); return d; }