Question: The hash _ text function will consume a string ( any kind of message ) and two integers ( base and hash _ size )
The hashtext function will consume a string any kind of message and two integers base and hashsize and produces an integer that attempts to uniquely represent the text.
Convert the string to a list of integers using ord.
Transform each integer of the list using the following formula: new value index baseold value Hint: to get the index, you can use the Count pattern or the builtin enumerate function.
Sum the list of integers.
Use the modulo operator to limit the total value to hashsize.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
