Closed
Description
util.string_to_number
seems different from int_to_string
def int_to_string(x): # pragma: no cover
"""Convert integer x into a string of bytes, as per X9.62."""
# deprecated in 0.19
warnings.warn(
"Function is unused in library code. If you use this code, "
"change to util.string_to_number.",
DeprecationWarning,
)
assert x >= 0
if x == 0:
return b"\0"
result = []
while x:
ordinal = x & 0xFF
result.append(int2byte(ordinal))
x >>= 8
result.reverse()
return b"".join(result)