I am sending the below url with query string. In the query string one parameter "approverCmt" has value with hash(#).
"/abc/efd/xyz.jas?approverCmt=Transaction Log #459505&batchNm=XS_10APR2015_082224&mfrNm=Timberland"
In server side when I tried to retrieve it from the request I get
approverCmt = Transaction Log -----> "#459505" is missing
batchNm = null
mfrNm = null
And If I remove hash(#) from query string or If I replace # with %23 every thing works fine
I don't understand why I am getting null for one parameter if another parameter contains a hash(#) symbol.
Appreciate if any one can explain.
A Hash is a dictionary-like collection of unique keys and their values. Also called associative arrays, they are similar to Arrays, but where an Array uses integers as its index, a Hash allows you to use any object type. Hashes enumerate their values in the order that the corresponding keys were inserted.
Hashing is a cryptographic process that can be used to validate the authenticity and integrity of various types of input. It is widely used in authentication systems to avoid storing plaintext passwords in databases, but is also used to validate files, documents and other types of data.
Characteristics of a Good Hash Function. There are four main characteristics of a good hash function: 1) The hash value is fully determined by the data being hashed. 2) The hash function uses all the input data. 3) The hash function "uniformly" distributes the data across the entire set of possible hash values.
An Example of a Hash Hashing the word “hello” will produce an output that is the same length as the hash for “I am going to the store.” The function used to generate the hash is deterministic, meaning that it will produce the same result each time the same input is used.
This is known as the "fragment identifier".
As mentioned in wikipedia:
The
fragment identifier
introduced by a hash mark # is the optional last part of aURL
for a document. It is typically used to identify a portion of that document.
The part after the #
is info for the client
. It is not sent to the server. Put everything only the browser needs here.
You can use the encodeURIComponent()
function in JavaScript to encode special characters in a URL, so that #
characters are converted to other characters that way you can be sure your whole URL will be sent to the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With