User blog comment:LittlePeng9/Encoding ordinals using binary strings/@comment-24509095-20140326145650/@comment-5529393-20140327024658

I'm not sure whether LittlePeng9 is allowing some numbers not to be used. If so, then your ordering works.