DM lab1 shift hash implementation