
| Current Path : /var/www/bavspeed/venvxxx/lib64/python3.12/site-packages/oscrypto/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/bavspeed/venvxxx/lib64/python3.12/site-packages/oscrypto/_int.py |
# coding: utf-8
"""
Function to fill ensure integers converted to a byte string are a specific
width. Exports the following items:
- fill_width()
"""
from __future__ import unicode_literals, division, absolute_import, print_function
__all__ = [
'fill_width',
]
def fill_width(bytes_, width):
"""
Ensure a byte string representing a positive integer is a specific width
(in bytes)
:param bytes_:
The integer byte string
:param width:
The desired width as an integer
:return:
A byte string of the width specified
"""
while len(bytes_) < width:
bytes_ = b'\x00' + bytes_
return bytes_