AnonymiseFilenames: use hex alphabet to remove chance to generate bad words

This commit is contained in:
Vendicated 2026-03-15 02:23:53 +01:00 committed by End
parent 9ef41602c5
commit 3caed057f6
No known key found for this signature in database

View file

@ -53,7 +53,7 @@ const settings = definePluginSettings({
randomisedLength: {
description: "Random characters length",
type: OptionType.NUMBER,
default: 7,
default: 10,
disabled: () => settings.store.method !== Methods.Random,
},
consistent: {
@ -123,7 +123,7 @@ export default definePlugin({
const newFilename = (() => {
switch (settings.store.method) {
case Methods.Random:
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
const chars = "ABCDEFabcdef0123456789";
return Array.from(
{ length: settings.store.randomisedLength },
() => chars[Math.floor(Math.random() * chars.length)]