This add ‘\0’ zerro padding
function zero_padding_add(data, blocksize)
local pad = blocksize - math.fmod(#data, blocksize)
return data .. string.rep('\0', pad)
end
and how i remove it ? this don`t work
function zero_padding_remove(data)
return string.gsub(data, "\0", '')
end
analog in php
rtrim($data, "\0");