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
parent b67bb009fc
commit d177f4d597
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18

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)]