Re: streql - Constant-time string comparison
On Sun, Nov 2, 2014 at 12:39 AM, Leslie S Satenstein
<lsatenstein@yahoo.com> wrote:
> Please explain from where or how you get xlen and ylen.
>
> Do you make a complete pass through the string looking for a NULL character?
> If you do, then you are going to check your string once for the length, and
> once for the matching.
The original source:
https://github.com/PeterScott/streql/blob/master/streql.c
Note this line:
if (!PyArg_ParseTuple(args, "et#et#", "utf8", &x, &xlen, "utf8", &y,
&ylen)) return NULL;
Riley is under the impression that Python strings are counted, rather
than NUL-terminated. Given the answers to
http://stackoverflow.com/questions/237128/is-there-a-reason-python-strings-dont-have-a-string-length-method
I'm pretty sure he's right.
> [...]
--
Joel Rees
Reply to: