Hash Function Typescript Interview