Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
115a0c68
Commit
115a0c68
authored
2 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
c: add dht_infohash_from_hex_null
parent
61b7bed0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
c/opendht.cpp
+5
-1
5 additions, 1 deletion
c/opendht.cpp
c/opendht_c.h
+1
-0
1 addition, 0 deletions
c/opendht_c.h
with
6 additions
and
1 deletion
c/opendht.cpp
+
5
−
1
View file @
115a0c68
...
...
@@ -76,7 +76,11 @@ bool dht_infohash_is_zero(const dht_infohash* h) {
}
void
dht_infohash_from_hex
(
dht_infohash
*
h
,
const
char
*
dat
)
{
*
h
=
dht_infohash_to_c
(
dht
::
InfoHash
(
std
::
string
(
dat
,
HASH_LEN
*
2
)));
*
h
=
dht_infohash_to_c
(
dht
::
InfoHash
(
std
::
string_view
(
dat
,
HASH_LEN
*
2
)));
}
void
dht_infohash_from_hex_null
(
dht_infohash
*
h
,
const
char
*
dat
)
{
*
h
=
dht_infohash_to_c
(
dht
::
InfoHash
(
std
::
string_view
(
dat
)));
}
const
char
*
dht_pkid_print
(
const
dht_pkid
*
h
)
{
...
...
This diff is collapsed.
Click to expand it.
c/opendht_c.h
+
1
−
0
View file @
115a0c68
...
...
@@ -50,6 +50,7 @@ typedef struct dht_infohash dht_infohash;
OPENDHT_C_PUBLIC
void
dht_infohash_zero
(
dht_infohash
*
h
);
OPENDHT_C_PUBLIC
void
dht_infohash_random
(
dht_infohash
*
h
);
OPENDHT_C_PUBLIC
void
dht_infohash_from_hex
(
dht_infohash
*
h
,
const
char
*
dat
);
OPENDHT_C_PUBLIC
void
dht_infohash_from_hex_null
(
dht_infohash
*
h
,
const
char
*
dat
);
OPENDHT_C_PUBLIC
void
dht_infohash_get
(
dht_infohash
*
h
,
const
uint8_t
*
dat
,
size_t
dat_size
);
OPENDHT_C_PUBLIC
void
dht_infohash_get_from_string
(
dht_infohash
*
h
,
const
char
*
str
);
OPENDHT_C_PUBLIC
const
char
*
dht_infohash_print
(
const
dht_infohash
*
h
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment