Implemented scan_by_key algorithm

The algorithms is adopted from AMD Bolt code, which has Apache 2.0 license.