Spark MLLIb has a HashingTF() function that computes document term frequencies based on a hashed value of each of the terms. 

1) what function does it use to do the hashing? 

2) How can I achieve the same hashed value from Python? 

3) If I want to compute the hashed output for a given single input, without computing the term frequency, how can I do this?