Hash function by multiplication method