If the offset is larger than the current length of the string at key, the string is padded with zero-bytes to make offset fit.
Non-existing keys are considered as empty strings, so this command will make sure it holds a string large enough
to be able to set value at offset.
Thanks to SETRANGE and the analogous GETRANGE commands, you can use Redis strings as a linear array with O(1) random access.
This is a very fast and efficient storage in many real world use cases.