package ro.pub.cs.pp.a51hadoop.algorithm.testing; import ro.pub.cs.pp.a51hadoop.algorithm.Hashfn; /* * Apply a hash function on a given string. */ public class DigitHashfn implements Hashfn { public String hashfn(String txt) { /* * This simple hashfn only exchanges the two halves of * a string and returns their new combination. * * This is used only in the testing phase to check * whether the rest of the framework works correclty. */ return txt.substring(txt.length() / 2, txt.length()) + txt.substring(0, txt.length() / 2); } }