diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2016-07-10 17:04:29 -0400 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2016-07-10 17:04:29 -0400 |
| commit | 1de5f9ac6f038bfed2230cc1272b253794b2f41a (patch) | |
| tree | 15bc9d515f1f48c036522afb7cc71f60243849a9 /gamemode/shared/lockbox/padding.lua | |
| download | artery-1de5f9ac6f038bfed2230cc1272b253794b2f41a.tar.gz artery-1de5f9ac6f038bfed2230cc1272b253794b2f41a.tar.bz2 artery-1de5f9ac6f038bfed2230cc1272b253794b2f41a.zip | |
Initial commit
Diffstat (limited to 'gamemode/shared/lockbox/padding.lua')
| -rw-r--r-- | gamemode/shared/lockbox/padding.lua | 21 |
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; |
