Last active
June 3, 2023 17:29
-
-
Save d4c5d1e0/e6ebcba43013769069ba743e779c9902 to your computer and use it in GitHub Desktop.
PerimeterX HoldCaptcha value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function UniformSampler(min, max) { | |
return Math.floor(Math.random() * (max - min)) + min; | |
} | |
// 1. generate 8 uuidv4 bytes | |
// Would have to be actually random | |
var buffer = | |
"4cbf32ae3046468b9f62b376ef70f3fd52405d54082f449d82a034585c8b6f599353b89b57bd45dcb13c8b9b7c6f33de9461c59897eb4fa9b63666c9c1e867564f95b63671334b0eacbe3c6ae6f8c2d3ef58ce12ea8d467e9ab202feed5c61144388426fd95f4c808e4de4747042eebdbdfc72817800494f9d6af3eeb02c6990"; | |
// ....-....-1..-....-d787dec486fa | |
// the px_uuid | |
const uuid = "d787dec486fa"; | |
// 2. choose random number between 88 & (256 - 12) ; 12 is the encoded size reserved to the last bits of the px_uuid | |
//The total length of the string will be the num choosed + 12 | |
const splice = UniformSampler(88, 244); | |
// 3. Pick a random number between 0 & step2 - 1 | |
//This will be the index where you will insert the last bits of the px_uuid | |
const insert = UniformSampler(0, splice - 1); | |
var temp = buffer.slice(0, splice); | |
// the dots are the uuid part | |
// 8cedb1ba090106f321847.............aa9cf153d50cdea5f3fd3099039530490ca2171f97c0f92ff06a4da | |
// ^ | |
// our insert index | |
var result = temp.substring(0, insert).concat(uuid).concat( | |
temp.substring(insert), | |
); | |
console.log(result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
+1 can vouch