Correctly allocate channel ids based on sort order of hashes