Skip to content
Advertisement

JavaScript crypto.randomBytes(8) to Python Code

I am working with Python in an API. The API is coded using Javascript, and I do not know how would be the equivalent code of this line in Python:

JavaScript

I found out this link https://docs.python.org/3/library/uuid.html, but I do not know what to do to get exactly the same result.

Thank you for your help

Advertisement

Answer

Try:

JavaScript

EDIT: If you need secure random bytes:

JavaScript

docs

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement