client code for randomized getdatabykey