Q:

Hashing a string value to the interval [0; 1]

I need to make hashing of pk values (e.g. 1289359, 345623p, etc.) to the interval [0; 1]. The mapping should be deterministic in order to get the same result every time I run the code (I don't want to use seed numbers). 
For example, the result of mapping 1289359 might be 0.35 (just an example).
How can I do it? Any hint would be highly appreciated.
It is preferable that the solution is given in Scala, but it might be also in Java.
UPDATE:
Sorry for not posting my code sample that I tried as a possible solution:
String myString = "345623p";
double value = Double.parseDouble(myString);

I don't know how to map it to the exact interval [0; 1].

A:

Your requirements are vague, but I think this satisfies them.
val r = scala.util.Random

val pks = List("1289359", "345623p")

val hashes = pks.map { pk =>
  r.setSeed(pk.hashCode())
  (pk, r.nextDouble())
}

List((1289359,0.36724077736416283), (345623p,0.243112317891797))

Note that there are some unexpected results of this approach. If the keys are very close (e.g. differ by the last char) then the hashes will also be very close, due to how scala's Random.nextDouble works.
List((1234560,0.40817931760409776), (1234561,0.4084480629207127), (1234562,0.4083584960496689), (1234563,0.41077718899804194))

