1local m = {}
2
3local getAlignSize
4if _VERSION == "Lua 5.3" then
5    getAlignSize = function(k, size)
6            return ((~k) + 1) & (size - 1)
7        end
8else
9    getAlignSize = function(self, size, additionalBytes)
10        local alignsize = bit32.bnot(#self.bytes-self:Head() + additionalBytes) + 1
11        return bit32.band(alignsize,(size - 1))
12    end
13end
14
15m.GetAlignSize = getAlignSize
16
17return m