From 88758ccce55e91deaf62a42c5316446e434824ce Mon Sep 17 00:00:00 2001 From: luzhisheng Date: Thu, 6 Apr 2023 17:10:14 +0800 Subject: [PATCH] =?UTF-8?q?68js=E5=8A=A0=E5=AF=86=E9=98=B2=E5=B9=B6?= =?UTF-8?q?=E5=8F=91=E8=B0=81=E8=83=BD=E5=B9=B6=E5=8F=91=E6=88=91=E5=8F=AB?= =?UTF-8?q?=E8=B0=81=E7=88=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../68js加密防并发谁能并发我叫谁爹/w-test.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 猿人学练习/68js加密防并发谁能并发我叫谁爹/w-test.js diff --git a/猿人学练习/68js加密防并发谁能并发我叫谁爹/w-test.js b/猿人学练习/68js加密防并发谁能并发我叫谁爹/w-test.js new file mode 100644 index 0000000..fd1e65b --- /dev/null +++ b/猿人学练习/68js加密防并发谁能并发我叫谁爹/w-test.js @@ -0,0 +1,23 @@ +const wp = require('whirlpool-js'); + +function hex_1_str(data){ + for (var s = 0; s <= 25000000; s++) { + result = wp.encSync(data.r + s.toString(), "hex"); + + if (result.slice(0, 10) === data.c) { + break; + } + } + return s; +} + +// const data = {"uuid": "e4c958f2d45611eda02c52540078cc4c", "c": "787aaa89c8", "r": "UCHQwxAwjX", "t": "eCOZi8Zg31uZsXxm3WKyeKSNRhrHh5RGCd+XifzvIwM="} +// +// a = hex_1_str(data); +// console.log(a); + + +module.exports = + { + hex_1_str + }; \ No newline at end of file