nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
a_star: don't crash on deserialization errors and limit static types
[nit.git]
/
lib
/
md5.nit
diff --git
a/lib/md5.nit
b/lib/md5.nit
index
3fee2f8
..
037c03d
100644
(file)
--- a/
lib/md5.nit
+++ b/
lib/md5.nit
@@
-500,15
+500,15
@@
redef class Text
fun md5: String do return to_cstring.native_md5.to_s
end
fun md5: String do return to_cstring.native_md5.to_s
end
-redef class NativeString
- private fun native_md5: NativeString `{
+redef class CString
+ private fun native_md5: CString `{
md5_state_t state;
md5_byte_t digest[16]; /* result */
char *hex_output = malloc(33*sizeof(char));
int di;
md5_init(&state);
md5_state_t state;
md5_byte_t digest[16]; /* result */
char *hex_output = malloc(33*sizeof(char));
int di;
md5_init(&state);
- md5_append(&state, (const md5_byte_t *)self, strlen(self));
+ md5_append(&state, (const md5_byte_t *)self, (int)strlen(self));
md5_finish(&state, digest);
for (di = 0; di < 16; ++di)
md5_finish(&state, digest);
for (di = 0; di < 16; ++di)