Skip to content

SFM61319/mtreits_favorite_interview_question

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

To run the program, run the following command from the project root directory:

$ cargo run --release -- <filename1>.bin <filename2>.bin <filename_out>.bin

You can also run the following script to generate random binary files:

import random

def generate_random_binary_file(filename: str, count: int):
    with open(filename, 'wb') as f:
        for _ in range(count):
            random_bytes = random.randbytes(4)
            f.write(random_bytes)

def main(argv: list[str]) -> int:
    if len(argv) < 3:
        print("Usage: python rng.py <filename>.bin <count>")
        return 1

    generate_random_binary_file(argv[1], int(argv[2]))
    return 0


if __name__ == '__main__':
    import sys

    code = main(sys.argv)
    sys.exit(code)

And run it as:

$ python rng.py <filename>.bin <count>

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages