aboutsummaryrefslogtreecommitdiff
path: root/gamemode/shared/lockbox/padding.lua
diff options
context:
space:
mode:
Diffstat (limited to 'gamemode/shared/lockbox/padding.lua')
-rw-r--r--gamemode/shared/lockbox/padding.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/gamemode/shared/lockbox/padding.lua b/gamemode/shared/lockbox/padding.lua
new file mode 100644
index 0000000..72be077
--- /dev/null
+++ b/gamemode/shared/lockbox/padding.lua
@@ -0,0 +1,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;