Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/asn1crypto/_int.py: 33%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
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_