feat: improve pick
This commit is contained in:
@@ -1126,7 +1126,7 @@ const matcher = (p1:string,matcherArg:matcherArg) => {
|
||||
}
|
||||
|
||||
function pickHashRand(cid:number,word:string) {
|
||||
let hashAddress = cid * 23515
|
||||
let hashAddress = 5515
|
||||
const rand = (word:string) => {
|
||||
for (let counter = 0; counter<word.length; counter++){
|
||||
hashAddress = ((hashAddress << 5) + hashAddress) + word.charCodeAt(counter)
|
||||
@@ -1134,6 +1134,10 @@ function pickHashRand(cid:number,word:string) {
|
||||
return hashAddress
|
||||
}
|
||||
const randF = sfc32(rand(word), rand(word), rand(word), rand(word))
|
||||
const v = cid % 1000
|
||||
for (let i = 0; i < v; i++){
|
||||
randF()
|
||||
}
|
||||
return randF()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user