コード例 #1
0
        string ObfuscateNameInternal(byte[] hash, RenameMode mode)
        {
            switch (mode)
            {
            case RenameMode.Empty:
                return("");

            case RenameMode.Unicode:
                return(CoreUtils.EncodeString(hash, unicodeCharset) + "\u202e");

            case RenameMode.Letters:
                return(CoreUtils.EncodeString(hash, letterCharset));

            case RenameMode.ASCII:
                return(CoreUtils.EncodeString(hash, asciiCharset));

            case RenameMode.Decodable:
                IncrementNameId();
                return("_" + CoreUtils.EncodeString(hash, alphaNumCharset));

            case RenameMode.Sequential:
                IncrementNameId();
                return("_" + CoreUtils.EncodeString(nameId, alphaNumCharset));

            default:

                throw new NotSupportedException("Rename mode '" + mode + "' is not supported.");
            }
        }