Added function to gen index for hash algo