-
Notifications
You must be signed in to change notification settings - Fork 0
/
mugunghwa.js
345 lines (288 loc) Β· 29.4 KB
/
mugunghwa.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
const LZString = require('./lz-string.min.js')
var isDebug = false
// νν°λ§ λμ§ μμ 98κ°μ§ κΈμ λͺ©λ‘μ΄ μ¬κΈ°μ λ΄κΉλλ€.
var nonFilteredCharMap = []
// μΈμ½λ© ν
μ΄λΈμ΄ μ¬κΈ°μ λ΄κΉλλ€.
var encodeTable = []
// μ€ν μ μ μ μν λ¬Έμ보μ ν
μ΄λΈμ΄ μ¬κΈ°μ λ΄κΉλλ€.
var charFixMap = {}
// λ¨μ΄λ‘ ꡬμ±λ μ€κ°μκ° μ¬κΈ°μ λ΄κΉλλ€.
var seperatorWord = []
// μμΆλ κΈμλͺ©λ‘μ
λλ€.
let compressedCharMap = 'hkNhyGwtDYJ02BdNgvTYI82B92wGe2A1OwNZ2AquwLN2A-uwP92A1A4A0DggwOATA4LsDgOIOAEg4CSDgNIOCMg4DGDgKYOA5g4IWDgGEOA7Q4AOhwCdDgG6HAIqOAJUcAGo4ETRwDejgB9HAEGOASMcAUY4BSxwA1jgFbHABOOASccAU44AFxwC7jgH3HAIeOBUCcAUM4F4ZwCIzgHJnAFTOBamcAQs4FxZwDorgBqrgDqrgC6rgKWrgCBrgDxrgLJrgCprgBVrgBUNgBBNgDdNgJ9NgCC9gCJ9gDVDgC+jgIBjgAnjgDsLgDhrQA'
let parsedCharMap = LZString.decompressFromEncodedURIComponent(compressedCharMap)
nonFilteredCharMap = String(parsedCharMap).split('')
// μμΆλ μ€κ°μλͺ©λ‘μ
λλ€.
let compressedSeperatorWord = 'idNh2hwAzeg2Q2gDQ0A'
// μμΆλ μ€κ°μλͺ©λ‘μ λΆλ¬μ΅λλ€.
let parsedSeperatorWord = LZString.decompressFromEncodedURIComponent(compressedSeperatorWord)
let pairSeperatorGroup = ''
for(let i=0;i<=parsedSeperatorWord.length;i++){
pairSeperatorGroup += parsedSeperatorWord[i]
if(pairSeperatorGroup.length == 2){
seperatorWord.push(pairSeperatorGroup)
pairSeperatorGroup = ''
}
}
// μμΆλ μΈμ½λ© ν
μ΄λΈμ
λλ€.
let compressedTable = 'hkNgum6F6bkH3bkDPbkBqdxA1ncQFV3ED-dxA1A8QDQPCCDA8IBMDwguwPCAEg8IIyDwgMYPCApg8IDmDwghYPCAYQ8IAOh4IBOh4IBuh4IAlR4IANR4IETR4IAfR4IAgx4IAox4IBSx4IAax4IBWx4IBJx4IApx4IAFx4IB9x4IFQJ4IAoZ4IByZ4IAqZ4IFqZ4IB0V4EANVeBAHVXgQBdV4EBS1eBAEDXgQB414EBZNeBAFTXgQAq14EAKhuBAC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AygaAPFGWhgxlB8AmOUvFQSaJlBqAU5NSrtU1rH07GPzTbgrzKB3AygkgMoDIFeHGjZJZQH4GUA0Dxy35ji9VROt425bIdZQMMGHrMOrGeT2FiK29d1vTOygcQMN2UBSC8eygWQMoAUDKDFAyglQMoDUDKBNAygrQaoByBbCSR9oHsf+JUCgCVBYAlQBAJUGQCVAZQBKCtJUBwAZZsc5eGgi0UFIzkNK+1bWqfQcZ-MzWlQaKEZ225K82+BAyoDIHeGmjtx8kymUTkP5ZxUOVNVKdX418taHUqAwwCPXv0LDdYz5NcLKK0qA8QfW0bsEHSoAiBZnGlwjcr3fjzS8zvDn3t9KgGoEqB6gSoCaBKgBfw6BKgXsEqBugOoEOgvYGoDQAagagDnJDqGoEYBz6Jxk+EagJQFcVtVQTXmc6XQTy59SA3VTnVFnBl2E8sveoBqAmCUUiXJTqa+jcY49YiwSsfrZZz59nfSgNOgA4cBFaBYAVoAQBYkMlAQwCsHonFIVyQ2lvoPGMFis5juNXgoFWgGQD+FDxdSUalM5ABW8VzlQ1SXVxNVoEDBkdVoDDB9jMU2bNSLJKz+tzbTuwwdWgCIBZcn3PLwX9WgGoFaBugUnElJ76Y8V8VLlY1RXVJNUrVR0OgBwDZcX3DoFaBpSDclPFTVNdWk0k9Dl17B0ga6BDhugBAG6BkAboASQZQboGpRm0RDFKwKcFvE4JBiGUk3JTKG6jNon6XxmhZ7WS9ns4LuTXkH5gRM8VAUAlM1XXUZNWwG6AwwboGT0v9Vw2lMOzKi3StgbG21wdNnTl2TcWgx72F8vfeoG6AmgIAA'
// μμΆλ μΈμ½λ©ν
μ΄λΈμ λΆλ¬μ΅λλ€.
let parsedTable = LZString.decompressFromEncodedURIComponent(compressedTable)
let pairGroup = ''
for(let i=0;i<=parsedTable.length;i++){
pairGroup += parsedTable[i]
if(pairGroup.length == 2){
encodeTable.push(pairGroup)
pairGroup = ''
}
}
// μμΆλ λ¬Έμ보μ ν
μ΄λΈμ
λλ€.
let compressedFixMap = 'N4IkGQ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vhAAzR9BAAEO9BAAX2iRABIxvgAFYJEACjG+EATjH0EAFjGJEAFLG+EAGY6JEABrG+EAUbGJEAFbG+EAGE6JEAAnG+EAQnH0AANnQQAXJokQAScb4QAdTvQQBWcYkQAKcb4QADTokQABcb4QBFcfQQAZcYkQAXcb4QAJpvQAAmdBAFdx9BAA1x9BABBx9BAHDxiRAB9xvgAEZ0EABab0EAGHH0EAA3H0EAAB70EAE+6JEAEPG+EASPGJEAVAm+EAWQn0EAWkmJEAChm+EAHcmJEAXhm+EAR8mJEAERm+EAFpmJEAHJm+EABSmJEACpm+EAHSmJEAWpm+EAQymJEACFm+EAHqmJEAXFm+EARamJEAHRW+EAG+WJEADVW+EABNX0EAa1X0EAYtWJEAHVW+EAW1X0EAC1X0EAA1WJEAF1W+EAE9X0EASNX0EAT9WJEAUtW+EAAtX0EAFNWJEAEDW+EAVDX0EABDWJEAHjW+EAGrWJEAWTW+EAXrWJEAFTW+EAVTX0EAczX0EAUzX0EASzWJEACrW+EASrX0EAbrWJAYGAQEAEsb0EAA4aJEACCa+EATCb0EAFCb0EAECaJEAG6a+EAC+b0EACYX0EADlaJEAT6a+EAUVb0EAVYX0EAV+aJEAEF6+EAD570EASF70EAF56JEAET6+EAHlX0EABIGJEAGqG+EAD5H0EAAiGJEAF9G+EAGg6JEAQDG+AABnQQBODvQQBADokQAE8b4QBE8fQQBi8fQQBC8YkQAdhb4QAZRfQQATJfQQAXxYkQAcNb4QAa1dIABfIA'
// μμΆλ λ¬Έμ보μ ν
μ΄λΈμ λΆλ¬μ΅λλ€.
let parsedFixMap = LZString.decompressFromEncodedURIComponent(compressedFixMap)
charFixMap = JSON.parse(parsedFixMap)
export default class mugunghwa {
/**
* λ³΅ν© λ€μ§μλ₯Ό 10μ§μλ‘ λ³νν©λλ€.
*/
static decimalBase(maxMatrix, indexMatrix) {
let indexDecimal = 0
for (let i = indexMatrix.length - 1; i >= 0; i--) {
let tempIndex = Number(indexMatrix[i])
for (let m = i + 1; m < indexMatrix.length; m++)
tempIndex *= Number(maxMatrix[m])
indexDecimal += tempIndex
}
return indexDecimal
}
/**
* 10μ§μλ₯Ό λ³΅ν© λ€μ§μλ‘ λ³νν©λλ€.
*/
static multipleBase(maxMatrix, indexDecimal) {
let temp = Number(indexDecimal)
let result = []
for (let i = maxMatrix.length - 1; i >= 0; i--) {
let up = Math.floor(temp / maxMatrix[i])
let down = temp - maxMatrix[i] * up
temp = up
result.push(down)
}
if (temp !== 0) result.push(temp)
result.reverse()
return result
}
static expectLength (index) {
let maxLength = 1
for (;;) {
let fullCase = Math.pow(72, maxLength)
if ((index + 1) <= fullCase) break
maxLength++
}
return maxLength
}
/**
* μμ κ°μ κΈμλ‘ μΈμ½λ©ν©λλ€.
*/
static encode (index, separator="-") {
// μ«μκ° μλμ§ μ¬λΆλ₯Ό νμΈν©λλ€.
// (μμμ μμμ μ«μ λν κ±°λΆν©λλ€.)
if(index === null || index === undefined || isNaN(index) || index < 0 || index%1 != 0)return null
// μΈμ½λ© λλ κΈμκΈΈμ΄ νμΈ
let maxLength = this.expectLength(index)
// κ³ μ λ²μ λ°°μ΄ μμ±
let max = []
for (let i = 0; i < maxLength; i++) max.push(72)
// 10μ§μλ₯Ό λ€μ§μ λ°°μ΄λ‘ λ³ν
let matrix = this.multipleBase(max, index)
let pairEncodedWord = ""
/*
if(isDebug){
console.log(`μ΅λ κ° λ°°μ΄: ${max}`)
console.log(`μμ κ° λ°°μ΄: ${matrix}`)
console.log("")
}
*/
// μΈμ½λ© μμ
if (max.length == 1) {
// μΈμ½λ© λλ μλ¦Ώμκ° 1κ°μΌλ 72μ§λ² κ·Έλλ‘ μ μ©
pairEncodedWord += nonFilteredCharMap[matrix[0]]
//if(isDebug) console.log(`νμλ¦Ώμ 72μ§λ² μ μ©: ${matrix[0]} -> ${nonFilteredCharMap[matrix[0]]}`)
}else{
// 2κ°μ© λͺ¨μμ 10μ§ν ν ν μΈμ½λ© μ μ©
let pairGroupLength = maxLength - maxLength % 2
let pairGroup = []
for (let i = 0; i < pairGroupLength; i++) {
pairGroup.push(matrix[i])
if(pairGroup.length == 2){
let pairIndex = this.decimalBase([72, 72], pairGroup)
// μ€λ²νλ‘μ°κ° λ°μνλ©΄ null μ²λ¦¬
if(typeof encodeTable[pairIndex] == 'undefined'){
//console.log(`! pairIndex:${pairIndex} pairGroup:${pairGroup}`)
return null
}
pairEncodedWord += encodeTable[pairIndex]
//if(isDebug) console.log(`μ§μλ¨μ 84μ§λ² μ μ©: [${pairGroup}] -> ${pairIndex} -> ${encodeTable[pairIndex]}`)
pairGroup = []
}
}
// λ§μ§λ§ νλκ° λ¨μΌλ©΄ λ¨μ μλ 72μ§λ² κ·Έλλ‘ μ μ©
if(maxLength % 2 == 1){
let lastOne = matrix[matrix.length-1]
if(typeof nonFilteredCharMap[lastOne] == 'undefined'){
return null
}
pairEncodedWord += nonFilteredCharMap[lastOne]
//if(isDebug) console.log(`μ§μλ¨μ 72μ§λ² μ μ©: ${lastOne} -> ${nonFilteredCharMap[lastOne]}`)
}
}
/*
if(isDebug){
console.log(`μ§μλ¨μ κ²μ΄λ κΈμμ‘°ν©: ${pairEncodedWord}`)
console.log("")
}
*/
/*
// μΈμ½λ© κΈμκΈΈμ΄κ° λ€μ―κΈμ μ΄μ μΌ λ
// νμλ¨μ λΆμ μ‘°ν© μΈμ½λ©μ μ μ©ν©λλ€.
if(maxLength >= 5){
let oddEncodedWord = ``
// μ λκΈμ λ°λ‘λ°μ
oddEncodedWord += pairEncodedWord[0]
oddEncodedWord += pairEncodedWord[1]
oddEncodedWord += pairEncodedWord[2]
// νμλ¨μ κ³μ°μμ (84μ§λ²->98μ§λ²)
let oddGroupMaxLength = maxLength - (((maxLength-3)%2==1)? 1 : 0)
let oddGroup = []
for(let i=3;i<=oddGroupMaxLength;i++){
oddGroup.push(pairEncodedWord[i])
if(oddGroup.length == 2){
let oddIndexGroup = [nonFilteredCharMap.indexOf(oddGroup[0]), nonFilteredCharMap.indexOf(oddGroup[1])]
let oddIndex = this.decimalBase([84,84], oddIndexGroup)
let oddEncode = encodeTable98[oddIndex]
oddEncodedWord += oddEncode
if(isDebug) console.log(`νμλ¨μ 98μ§λ² μ μ©: ${oddGroup.join(``)} -> [${oddIndexGroup}] -> ${oddIndex} -> ${oddEncode}`)
oddGroup = []
}
}
if((maxLength-3)%2==1)
oddEncodedWord += pairEncodedWord[pairEncodedWord.length-1]
if(isDebug) console.log(`νμλ¨μ κ²μ΄λ κΈμμ‘°ν©: ${oddEncodedWord}`)
pairEncodedWord = oddEncodedWord
}
*/
// μ½λλ₯Ό μͺΌκ° ν ꡬλΆμλ₯Ό λΆμ
λλ€.
let code = []
for(let i=0;i<=pairEncodedWord.length-1;i++){
code.push(pairEncodedWord[i])
if((pairEncodedWord.length-1)!=i && (i+1)%2==0)code.push(separator)
}
return code.join("")
}
static decode(code, separator="-"){
if(code === undefined || code === null || String(code).length == 0)
return null
// ꡬλΆμμ 곡백μ μ κ±°ν ν λ°°μ΄ν ν©λλ€.
let decodedCode = String(code).split(separator).join("").split(" ").join("").split("")
//if(isDebug)console.log(`ꡬλΆμ μ κ±°λ μ½λ: [${decodedCode}]`)
let isWrongTypeExist = null
// λκΈμ λ¨μλ‘ λ¨μ/λμλΌλ ꡬλΆμ ννμ΄
// ν¬ν¨λμ΄ μλμ§ νμΈ ν μλ€λ©΄ μμ ν©λλ€.
let seperatorDecodedCode = ""
let pairGroup = ""
let pairLength = decodedCode.length - ((decodedCode.length % 2 == 1)? 1 : 0)
for(let i=0;i<=(pairLength-1);i++){
pairGroup += decodedCode[i]
if(pairGroup.length == 2){
let pairGroupStr = String(pairGroup)
if(seperatorWord.indexOf(pairGroupStr) != -1){
pairGroup = ""
continue
}
seperatorDecodedCode += pairGroup
pairGroup = ""
}
}
// λ§μ§λ§ λ¨μ μμ 72μ§λ²μ μΆκ°ν©λλ€.
if(decodedCode.length % 2 == 1){
let lastOne = decodedCode[decodedCode.length-1]
seperatorDecodedCode += lastOne
}
// ꡬλΆμλ₯Ό μμ ν μ½λλ₯Ό λ°μν©λλ€.
decodedCode = seperatorDecodedCode.split("")
//if(isDebug)console.log(`ꡬλΆλ¨μ΄ μ κ±°λ μ½λ: [${decodedCode}]`)
// μλͺ» μ
λ ₯λ μ€νμκ° μλμ§ κ²μ¬ν©λλ€.
for(let n=0;n<=(decodedCode.length-1);n++){
// μλͺ»λ μ€νμκ° μ‘΄μ¬νλ©΄ ν΄λΉ κΈμμ μμ μ μλν©λλ€.
if(nonFilteredCharMap.indexOf(decodedCode[n]) == -1){
isWrongTypeExist = decodedCode[n]
// μ€νμ μμ λͺ©λ‘μ μ νν©λλ€.
for(let charFixMapIndex of Object.keys(charFixMap)){
// μμ κ°λ₯ν κΈμκ° μλμ§ νμΈν©λλ€.
let fixableType = null
for(let charFixMapValue of charFixMap[charFixMapIndex]){
if(charFixMapValue == decodedCode[n]){
fixableType = charFixMapIndex
break
}
}
// μμ κ°λ₯ν κΈμκ° μλ€λ©΄
// μμ ν ν λ€μ κΈμλ₯Ό κ²μ¬ν©λλ€.
if(fixableType !== null){
isWrongTypeExist = null
decodedCode[n] = fixableType
//if(isDebug)console.log(`μ€νμ μμ λ¨: ${decodedCode[n]} -> ${fixableType}`)
break
}
}
}
}
if(isWrongTypeExist !== null){
// λλ²κΉ
λͺ¨λκ° μλλΌλ©΄ κ·Έλ₯ nullμ λ°νμν΅λλ€.
if(!isDebug) return null
// μμ λΆκ°λ₯ν μ€νμκ° μ‘΄μ¬νλ©΄ μ€λ₯λ₯Ό λ°μμν΅λλ€.
throw new Error(`Unrecognized code: ${code}\nWrong Typo: ${isWrongTypeExist}`)
}
// ν΄μλ 72μ§λ² λ°°μ΄μ΄ μ¬κΈ°μ λ΄κΉλλ€.
let decodedMatrix = []
// μ§μλ¨μ μΈμ½λ©μ ν΄μν©λλ€.
pairGroup = ""
pairLength = decodedCode.length - ((decodedCode.length % 2 == 1)? 1 : 0)
for(let i=0;i<=(pairLength-1);i++){
pairGroup += decodedCode[i]
if(pairGroup.length == 2){
let pairIndex = encodeTable.indexOf(pairGroup)
// 84μ§λ² μ¬μ μμ νμΈλμ§ μλ λ¨μ΄κ° λ°κ²¬λ μ
// μΈμν μ μλ μ½λλ‘ κ°μ£Όν΄μ μ€λ₯λ₯Ό λ°μμν΅λλ€.
if(pairIndex == -1){
// λλ²κΉ
λͺ¨λκ° μλλΌλ©΄ κ·Έλ₯ nullμ λ°νμν΅λλ€.
if(!isDebug) return null
throw new Error(`Unrecognized code: ${code}\nWrong Format: ${pairGroup}`)
}
let pairMatrix = this.multipleBase([72,72], pairIndex)
decodedMatrix = decodedMatrix.concat(pairMatrix)
//if(isDebug)console.log(`μ§μλ¨μ 84μ§λ² 볡μ: ${pairGroup} -> ${pairIndex} -> [${pairMatrix}]`)
pairGroup = ""
}
}
// λ§μ§λ§ λ¨μ μμ 72μ§λ²μ ν΄μν©λλ€.
if(decodedCode.length % 2 == 1){
let lastOne = [nonFilteredCharMap.indexOf(decodedCode[decodedCode.length-1])]
decodedMatrix = decodedMatrix.concat(lastOne)
}
// μ΅λ κ° λ²μ λ°°μ΄μ μμ±ν©λλ€.
let max = []
for(let i=0;i<=(decodedMatrix.length-1);i++) max.push(72)
/*
if(isDebug){
console.log("")
console.log(`μ΅λ κ° λ°°μ΄: ${max}`)
console.log(`μμ κ° λ°°μ΄: ${decodedMatrix}`)
console.log("")
}
*/
// 10μ§μ μμΈλ²νΈλ‘ λ³νν©λλ€.
let decodedIndex = this.decimalBase(max, decodedMatrix)
//if(isDebug) console.log(`μ½λλ²νΈ: ${decodedIndex}`)
return decodedIndex
}
}