aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/lockbox/padding.lua
blob: 72be0779e5e2db8d94010ee6575c375c59d00d98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local Stream = include("stream.lua");

local ZeroPadding = function(blockSize,byteCount)

	local paddingCount = blockSize - ((byteCount -1) % blockSize) + 1;
	local bytesLeft = paddingCount;

	local stream = function()
		if bytesLeft > 0 then
			bytesLeft = bytesLeft - 1;
			return 0x00;
		else
			return nil;
		end
	end

	return stream;

end

return ZeroPadding;