From 9222e26aeabd41208e96ed1f87bb71c0dae95a04 Mon Sep 17 00:00:00 2001 From: Theo Beers Date: Mon, 9 Dec 2024 15:47:05 -0500 Subject: [PATCH] Remove vestigial file --- src/pykubegrader/hash_seed.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 src/pykubegrader/hash_seed.py diff --git a/src/pykubegrader/hash_seed.py b/src/pykubegrader/hash_seed.py deleted file mode 100644 index 68b8a89..0000000 --- a/src/pykubegrader/hash_seed.py +++ /dev/null @@ -1,27 +0,0 @@ -import hashlib - - -def hash_to_seed(input_string: str) -> int: - """ - Hash a string into a small integer seed less than 500. - - Parameters: - input_string (str): The string to hash. - - Returns: - int: A seed value (0 <= seed < 500). - """ - - # Cast input to string, just in case - input_string = str(input_string) - - # Create a SHA-256 hash of the string - hash_object = hashlib.sha256(input_string.encode()) - - # Convert the hash to an integer - large_number = int.from_bytes(hash_object.digest(), "big") - - # Reduce the number to a value less than 500 - small_seed = large_number % 500 - - return small_seed