User:Myee:修订间差异
(增加了 l.w/c 的密码生成方式) |
小 (调整代码块格式) |
||
第5行: | 第5行: | ||
原 l.w/c 动态密码生成算法(引用自 [https://github.com/zh-arc-wiki-re-wg/lowestworld_algorithm/blob/main/in_javascript.js GitHub]) | 原 l.w/c 动态密码生成算法(引用自 [https://github.com/zh-arc-wiki-re-wg/lowestworld_algorithm/blob/main/in_javascript.js GitHub]) | ||
<pre> | |||
const getCode = function(y,m,d){ | |||
const pattern = "qwertyuiopasdfghjklzxcvbnm1234567890"; | const pattern = "qwertyuiopasdfghjklzxcvbnm1234567890"; | ||
const raw = "".concat(y, "ori").concat(m, "wol").concat(d, "oihs").concat(d, "otas"); | const raw = "".concat(y, "ori").concat(m, "wol").concat(d, "oihs").concat(d, "otas"); | ||
第19行: | 第20行: | ||
const d = new Date(); | const d = new Date(); | ||
return getCode(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()) | return getCode(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()) | ||
})</pre | }) | ||
</pre> |
2023年8月18日 (五) 22:33的最新版本
纯萌新,请多多见教。QwQ
原 l.w/c 动态密码生成算法(引用自 GitHub)
const getCode = function(y,m,d){ const pattern = "qwertyuiopasdfghjklzxcvbnm1234567890"; const raw = "".concat(y, "ori").concat(m, "wol").concat(d, "oihs").concat(d, "otas"); const initial = hex_md5(raw); const result = []; initial.split('').forEach(function (val) { result.push(pattern[val.charCodeAt() % 36]); }); const res = result.join(''); return res[1].concat(res[20], res[4], res[30], res[2], res[11], res[23]); } const code_from_alg = computed(()=>{ const d = new Date(); return getCode(d.getUTCFullYear(), d.getUTCMonth(), d.getUTCDate()) })