zero.lua 406 B

12345678910111213141516171819
  1. local ZeroPadding = function(blockSize, byteCount)
  2. local paddingCount = blockSize - ((byteCount -1) % blockSize) + 1;
  3. local bytesLeft = paddingCount;
  4. local stream = function()
  5. if bytesLeft > 0 then
  6. bytesLeft = bytesLeft - 1;
  7. return 0x00;
  8. else
  9. return nil;
  10. end
  11. end
  12. return stream;
  13. end
  14. return ZeroPadding;