Skip to content

Commit

Permalink
use os.urandom()
Browse files Browse the repository at this point in the history
  • Loading branch information
FoamyGuy committed May 2, 2024
1 parent a8b78ad commit 5a2934e
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions adafruit_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

import errno
import json as json_module
import random
import os
import sys

from adafruit_connection_manager import get_connection_manager
Expand Down Expand Up @@ -418,11 +418,7 @@ def _build_boundary_data(self, files: dict): # pylint: disable=too-many-locals

@staticmethod
def _build_boundary_string():
hex_characters = "0123456789abcdef"
_boundary = ""
for _ in range(32):
_boundary += random.choice(hex_characters)
return _boundary
return os.urandom(16).hex()

@staticmethod
def _check_headers(headers: Dict[str, str]):
Expand Down

0 comments on commit 5a2934e

Please sign in to comment.