多次运行go测试时,crypto / rand产生相同的结果

时间:2019-05-29 03:21:32

标签: go random

在使用中,加密货币/兰特在密码学上是安全的。那么,当我多次对同一代码进行go测试时,为什么会生成相同的结果呢?

相关代码:

const regex = /<\/[a-z]+>(?:\s+)<[a-z]+>/gm;
const str = `<p>leave white spaces</p>   <p>leave white spaces</p>    <p>leave white spaces</p>   <p>leave white spaces</p><p>leave white spaces</p>   <p>leave white spaces</p>    <p>leave white spaces</p>   <p>leave white spaces</p>
<p>leave white spaces</p>   <p>leave white spaces</p>    <p>leave white spaces</p>   <p>leave white spaces</p><p>leave white spaces</p>   <p>leave white spaces</p>    <p>leave white spaces</p>   <p>leave white spaces</p>
<p>leave white spaces</p>   <p>leave white spaces</p>    <p>leave white spaces</p>   <p>leave white spaces</p><p>leave white spaces</p>   <p>leave white spaces</p>    <p>leave white spaces</p>   <p>leave white spaces</p>

`;
const subst = ``;

// The substituted value will be contained in the result variable
const result = str.replace(regex, subst);

console.log(result);

0 个答案:

没有答案