Ranjith2523
New member
- Joined
- Mar 3, 2023
- Messages
- 3
- Programming Experience
- Beginner
Hi Friends,
This is my first post in this forum. Can someone please help me to understand this question (little simple explanation about this question in easy understandable English) and find out the solution ? Thanks for all your help in advance.
Question:
Find out the input string that was passed to the following hash function
That produced the hashed output (integer value) as
945901726134069
Provided, the input string length was 9 and contains only characters
from the below string
"acdegilmnoprstuw"
Note: You need to reverse engineer the above hash logic and find out the
answer.
HELP:
String - a data type that holds collection of characters, an array of
characters with zero- based index. Hash - Modify an input value to a
different one using which one cannot easily find out the original value.
Dehash - Find the original input value that was modified by hashing.
Function - a code snippet that accepts zero or more number of input
parameters and return either no value or a value. Integer - a data type
that holds both positive and negative full numbers.
<string_variable>.IndexOf - an in-built function in any programming
language that finds out the starting index of any substring (one or more
characters together) inside the value stored in string_variable.
<string_variable>[<integer_variable>] - an expression that returns the
character at the-index specified by the value of integer_variable
This is my first post in this forum. Can someone please help me to understand this question (little simple explanation about this question in easy understandable English) and find out the solution ? Thanks for all your help in advance.
Question:
Find out the input string that was passed to the following hash function
C#:
Integer Hash (String inputString)
Integer outputNumber = 7;
String letters = "acdegilmnoprstuw";
Integer index = 0;
Integer lengthOfInputString = inputString.Length;
while (index < lengthOfInputString)
{
outputNumber = (outputNumber* 37+ letters.IndexOf (inputString
[index]));
index = index + 1;
}
return outputNumber;
}
945901726134069
Provided, the input string length was 9 and contains only characters
from the below string
"acdegilmnoprstuw"
Note: You need to reverse engineer the above hash logic and find out the
answer.
HELP:
String - a data type that holds collection of characters, an array of
characters with zero- based index. Hash - Modify an input value to a
different one using which one cannot easily find out the original value.
Dehash - Find the original input value that was modified by hashing.
Function - a code snippet that accepts zero or more number of input
parameters and return either no value or a value. Integer - a data type
that holds both positive and negative full numbers.
<string_variable>.IndexOf - an in-built function in any programming
language that finds out the starting index of any substring (one or more
characters together) inside the value stored in string_variable.
<string_variable>[<integer_variable>] - an expression that returns the
character at the-index specified by the value of integer_variable
Last edited by a moderator: