简体   繁体   English

从给定的系列中获取 python 中的随机模块种子?

[英]Getting random module seed in python from a given series?

I've been doing some digging about the library of babel online and wanted to replicate its core functionality but I have no idea where to begin other than the random module on python.我一直在在线挖掘 babel 库,并希望复制其核心功能,但除了 python 上的随机模块之外,我不知道从哪里开始。 I understand that you can input a seed to it and it generates the same series over and over again.我知道您可以向它输入一个种子,它会一遍又一遍地生成相同的系列。 I wonder if there's a way to reverse this process wherein one would enter an array and get the seed out.我想知道是否有一种方法可以逆转这个过程,其中一个人会进入一个数组并取出种子。 I've been looking and there doesn't seem to be any leads.我一直在寻找,似乎没有任何线索。 Is it even possible?甚至有可能吗?

It is not possible to get the seed that was used when generating a list of numbers using the random module in Python.这是不可能得到的seed生成使用号码列表时使用random的Python模块。

I would suggest storing the seed that was initially used when generating the pseudo-random list, so you can infer it later on where needed.我建议存储最初在生成伪随机列表时使用的种子,以便您稍后可以在需要的地方进行推断。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM