Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/asn1crypto/_int.py: 40%
5 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:25 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-07 06:25 +0000
1# coding: utf-8
2from __future__ import unicode_literals, division, absolute_import, print_function
5def fill_width(bytes_, width):
6 """
7 Ensure a byte string representing a positive integer is a specific width
8 (in bytes)
10 :param bytes_:
11 The integer byte string
13 :param width:
14 The desired width as an integer
16 :return:
17 A byte string of the width specified
18 """
20 while len(bytes_) < width:
21 bytes_ = b'\x00' + bytes_
22 return bytes_