[Tutor] Clarification questions about how Python uses references.

Cameron Simpson cs at cskk.id.au
Thu Jun 24 21:05:31 EDT 2021


On 24Jun2021 19:46, Dennis Lee Bieber <wlfraed at ix.netcom.com> wrote:
>On Thu, 24 Jun 2021 12:36:33 -0500, boB Stepp <robertvstepp at gmail.com>
>declaimed the following:
>>Then I suppose "MD5" and similar terms refer to the algorithm being
>>employed to come up with this mapping of values.
>>
>	MD5 is more used to create a value that can be used to verify a file
>has not been corrupted (by rerunning the MD5 algorithm on the file and
>comparing the message-digest value to that provided [independently] by the
>supplier of said file). It isn't used to "index" any structure.

Not in Python internals I guess. But I've seen them used as keys in data 
structures and as, effectively, job names for user requests (hash the 
request, which is unique eg JSON with user id and request number etc) 
which becomes an index of sorts. And of course in memory if manipulating 
things associated with same.

>	The final assignment in my data structures course required 
>	implementing
>a hashed-head multiple linked-list system. (Seems Wikipedia refers to them
>as "hashing with chaining"). The only place I've seen such a structure used
>in an actual application is the Amiga file-system.
>
>	Each directory block held room for something like 64 entries. Each
>entry had a pointer to a list of [file header | (sub)directory header].
>Each header block held the name of the file/directory (there is the
>comparison source). File headers held pointers to 64 data blocks; if the
>file was larger than that, a link to an overflow block was provided, for
>the next 64 data blocks, etc. Finding a file/directory required hashing the
>current path component, then following the linked list comparing the name
>of the path component to the name stored in the linked header blocks.

Pretty sure most modern filesystems use hashed directories in order to 
support efficient lookup of large/wide directories (having many 
entries). I'd expect an analogous structure there.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Tutor mailing list