Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I think
-1
and0
are equally bad (as a caller might be unaware that the function also uses the output parameter as an error indicator and may end up callingmalloc(utf8_strlen(x))
).I guess a better way would be?
uint32_t utf8_strlen(char *, uint8_t * errcode);
Re-published, thanks.
I did, thanks.
Ok thanks.
I've republished it following your suggestions.
int8_t
makes sense - because of simmetry with the test definition.But why is
uint32_t
preferred?Is there any 64bit platform where
unsigned int
is not 4 bytes long?Thank you.
I was sure the C standard defines the default signedness (to signed), but I was wrong.
Thanks, changed to
int8_t
.I've addressed both issues and re-published. Thanks.
Thanks, I've re-published with a random buffer test (and found a bug in my implementation :)).
Also made the reference solution static.
Sure, but the C source is available anyway, in Wikipedia (one search away).
And using the compiler is besides the point for someone trying to use NASM, no?
I mean most of the NASM katas can be solved in C and translated into assembler using a compiler.
Thanks, i've republished it with
0x%08x
.I don't know, it can work both ways.
Hashing a null terminated string is a special case of the hashing function that works over arbitrary input.
I thought it's better to keep the kata closer to the initial goal - port a simple C implementation to NASM.
You are right.
I think i've fixed it, thanks for you patience :).
Are you reffering to the fact that the function in the description works for binary input (and thus it requests input length) vs the required implementation that assumes input is a null terminated string?
Updated to eax, thanks.
I've changed ub4 to uint32_t, thanks
Loading more items...