[cfe-dev] [libc++] Initial attempt to make a salted hash

Zhihao Yuan zy at miator.net
Sat Aug 31 12:03:31 PDT 2013


On Sat, Aug 31, 2013 at 2:37 PM, Howard Hinnant <hhinnant at apple.com> wrote:
> [hash.requirements]/ Table 26 says:
>
>> The value returned shall depend only on the argument k. [ Note: Thus all evaluations of the expression h(k) with the same value for k yield the same result. — end note ]

I know.  But the wording here is not clear: does that mean two
different standard library implementations have to share the
same hash function?  Obviously not.

> Now it isn't clear, at least to me, that if this is talking about all evaluation within the process, or across different invocations of the same process, or even across invocations of different processes.  Without guidance from the LWG, I think we need to assume the most conservative answer.

Tend to agree.

> I faintly recall this subject was brought up at the Portland meeting, Fall 2012.  I do not believe anything was definitively resolved at that time.  I do not know if this issue was discussed this Spring in Bristol.  I do not see an LWG issue on this subject.

I guess it's inside

  http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2012/n3333.html

Thanks to the labor day, the deadline is extended.  Can I submit
an issue like

"The value returned shall depend only on the argument k<ins> for
the duration of the program</ins>  [ Note: Thus all evaluations of the
expression h(k) with the same value for k yield the same result
<ins> for each execution of the program(, some guideline here?)</ins>.
— end note ]"

The hashing can't be per-process BTW.  First the standard knows
nothing about OS process; second, practically that makes you unable
to share an unordered container to a child process :(

-- 
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/




More information about the cfe-dev mailing list