Generates a storable representation of a value