Files
XiangYue/js/mapping-mode-4.js
风之暇想 5e3de2f23c v1.4.0.0
2025-08-15 19:25:35 +08:00

4 lines
2.0 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const CharSets4={"A":["ザ","ヒ","ケ"],"B":["ょ","ぴ","ド"],"C":["ヵ","ひ","ㇱ"],"D":["か","ウ","び"],"E":["ㇰ","ピ","ト"],"F":["モ","ン","レ"],"G":["マ","ぼ","ィ"],"H":["い","ゲ","ㇲ"],"I":["ゖ","ㇵ","る"],"J":["グ","ゟ","サ"],"K":["ォ","ュ","ㇿ"],"L":["ん","ゥ","ゔ"],"M":["セ","〲","゛"],"N":["れ","す","わ"],"O":["ダ","ゴ","そ"],"P":["ㇷ","ヴ","ぞ"],"Q":["ぽ","づ","じ"],"R":["つ","み","バ"],"S":["デ","ま","ㇼ"],"T":["な","ヹ","ぁ"],"U":["〻","お","ㇻ"],"V":["プ","ギ","ベ"],"W":["ゎ","ョ","に"],"X":["ヷ","こ","が"],"Y":["ざ","ヘ","ス"],"Z":["ゃ","ア","ミ"],"a":["ね","ふ","ゝ"],"b":["","ソ","ば"],"c":["ズ","ぺ","ペ"],"d":["ㇽ","ぐ","ゑ"],"e":["ゾ","ァ","ぅ"],"f":["ポ","も","ぷ"],"g":["ご","ㇸ","し"],"h":["ル","む","ら"],"i":["ヾ","ㇹ","ろ"],"j":["ジ","ャ","ボ"],"k":["ヲ","シ","ゼ"],"l":["ゐ","ッ","え"],"m":["ワ","テ","ヿ"],"n":["〴","う","き"],"o":["パ","ㇶ","ガ"],"p":["を","ラ","っ"],"q":["リ","ヂ","ゕ"],"r":["ぎ","メ","ヶ"],"s":["ク","〵","ビ"],"t":["ヺ","で","く"],"u":["よ","ゆ","ㇺ"],"v":["の","ぉ",""],"w":["フ","ム","せ"],"x":["ゞ","や","々"],"y":["め","タ","ぬ"],"z":["ㇳ","べ","チ"],"0":["ナ","だ","げ"],"1":["ぶ","け","ェ"],"2":["ヱ","ヨ","ぇ"],"3":["た","ゅ","ち"],"4":["ぃ","キ","ぢ"],"5":["ブ","ニ","ヸ"],"6":["ヮ","ほ","り"],"7":["ぱ","ぜ","ヌ"],"8":["ネ","ㇴ","ユ"],"9":["さ","ㇾ","ど"],"+":["て","イ","ヤ"],"/":["ツ","ず","ヅ"],"=":["は","と","あ"]};const JP2B64=new Map();for(const[b64,arr]of Object.entries(CharSets4)){const code=b64.charCodeAt(0);for(const ch of arr){JP2B64.set(ch,code);}}
const mappingMode4={Base64ToJapanese(b64){const out=[];for(const ch of b64){const pool=CharSets4[ch];if(pool)out.push(pool[Math.floor(Math.random()*pool.length)]);}
return out.join('');},JapaneseToBase64(str){const out=[];for(const ch of str){const code=JP2B64.get(ch);if(code!==undefined)out.push(String.fromCharCode(code));}
return out.join('');}};