1. A method to encode data on a single-level flash memory by use of rank modulation, the method comprising: determining a bit ranking within a group of bits based on the data to he encoded; determining a number of program pulses to modify each respective bit in the group of bits from a first value to a second value; determining a program vector based on the determined bit ranking and the determined number of program pulses, wherein each element in the program vector includes the number of program pulses to modify a given bit of the group of bits from the first value to the second value; and encoding the data to the group of bits, using partial programming, based on the determined program vector.