First version of a function which generate context dependant id