碧桂园
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

280 行
7.8 KiB

  1. var CryptoJS = CryptoJS || function (h, i) {
  2. var e = {},
  3. f = e.lib = {},
  4. l = f.Base = function () {
  5. function a() {}
  6. return {
  7. extend: function (j) {
  8. a.prototype = this;
  9. var d = new a;
  10. j && d.mixIn(j);
  11. d.$super = this;
  12. return d
  13. },
  14. create: function () {
  15. var a = this.extend();
  16. a.init.apply(a, arguments);
  17. return a
  18. },
  19. init: function () {},
  20. mixIn: function (a) {
  21. for (var d in a) a.hasOwnProperty(d) && (this[d] = a[d]);
  22. a.hasOwnProperty("toString") && (this.toString = a.toString)
  23. },
  24. clone: function () {
  25. return this.$super.extend(this)
  26. }
  27. }
  28. }(),
  29. k = f.WordArray = l.extend({
  30. init: function (a, j) {
  31. a =
  32. this.words = a || [];
  33. this.sigBytes = j != i ? j : 4 * a.length
  34. },
  35. toString: function (a) {
  36. return (a || m).stringify(this)
  37. },
  38. concat: function (a) {
  39. var j = this.words,
  40. d = a.words,
  41. c = this.sigBytes,
  42. a = a.sigBytes;
  43. this.clamp();
  44. if (c % 4)
  45. for (var b = 0; b < a; b++) j[c + b >>> 2] |= (d[b >>> 2] >>> 24 - 8 * (b % 4) & 255) << 24 - 8 * ((c + b) % 4);
  46. else if (65535 < d.length)
  47. for (b = 0; b < a; b += 4) j[c + b >>> 2] = d[b >>> 2];
  48. else j.push.apply(j, d);
  49. this.sigBytes += a;
  50. return this
  51. },
  52. clamp: function () {
  53. var a = this.words,
  54. b = this.sigBytes;
  55. a[b >>> 2] &= 4294967295 << 32 - 8 * (b % 4);
  56. a.length = h.ceil(b / 4)
  57. },
  58. clone: function () {
  59. var a =
  60. l.clone.call(this);
  61. a.words = this.words.slice(0);
  62. return a
  63. },
  64. random: function (a) {
  65. for (var b = [], d = 0; d < a; d += 4) b.push(4294967296 * h.random() | 0);
  66. return k.create(b, a)
  67. }
  68. }),
  69. o = e.enc = {},
  70. m = o.Hex = {
  71. stringify: function (a) {
  72. for (var b = a.words, a = a.sigBytes, d = [], c = 0; c < a; c++) {
  73. var e = b[c >>> 2] >>> 24 - 8 * (c % 4) & 255;
  74. d.push((e >>> 4).toString(16));
  75. d.push((e & 15).toString(16))
  76. }
  77. return d.join("")
  78. },
  79. parse: function (a) {
  80. for (var b = a.length, d = [], c = 0; c < b; c += 2) d[c >>> 3] |= parseInt(a.substr(c, 2), 16) << 24 - 4 * (c % 8);
  81. return k.create(d, b / 2)
  82. }
  83. },
  84. q = o.Latin1 = {
  85. stringify: function (a) {
  86. for (var b =
  87. a.words, a = a.sigBytes, d = [], c = 0; c < a; c++) d.push(String.fromCharCode(b[c >>> 2] >>> 24 - 8 * (c % 4) & 255));
  88. return d.join("")
  89. },
  90. parse: function (a) {
  91. for (var b = a.length, d = [], c = 0; c < b; c++) d[c >>> 2] |= (a.charCodeAt(c) & 255) << 24 - 8 * (c % 4);
  92. return k.create(d, b)
  93. }
  94. },
  95. r = o.Utf8 = {
  96. stringify: function (a) {
  97. try {
  98. return decodeURIComponent(escape(q.stringify(a)))
  99. } catch (b) {
  100. throw Error("Malformed UTF-8 data");
  101. }
  102. },
  103. parse: function (a) {
  104. return q.parse(unescape(encodeURIComponent(a)))
  105. }
  106. },
  107. b = f.BufferedBlockAlgorithm = l.extend({
  108. reset: function () {
  109. this._data = k.create();
  110. this._nDataBytes = 0
  111. },
  112. _append: function (a) {
  113. "string" == typeof a && (a = r.parse(a));
  114. this._data.concat(a);
  115. this._nDataBytes += a.sigBytes
  116. },
  117. _process: function (a) {
  118. var b = this._data,
  119. d = b.words,
  120. c = b.sigBytes,
  121. e = this.blockSize,
  122. g = c / (4 * e),
  123. g = a ? h.ceil(g) : h.max((g | 0) - this._minBufferSize, 0),
  124. a = g * e,
  125. c = h.min(4 * a, c);
  126. if (a) {
  127. for (var f = 0; f < a; f += e) this._doProcessBlock(d, f);
  128. f = d.splice(0, a);
  129. b.sigBytes -= c
  130. }
  131. return k.create(f, c)
  132. },
  133. clone: function () {
  134. var a = l.clone.call(this);
  135. a._data = this._data.clone();
  136. return a
  137. },
  138. _minBufferSize: 0
  139. });
  140. f.Hasher = b.extend({
  141. init: function () {
  142. this.reset()
  143. },
  144. reset: function () {
  145. b.reset.call(this);
  146. this._doReset()
  147. },
  148. update: function (a) {
  149. this._append(a);
  150. this._process();
  151. return this
  152. },
  153. finalize: function (a) {
  154. a && this._append(a);
  155. this._doFinalize();
  156. return this._hash
  157. },
  158. clone: function () {
  159. var a = b.clone.call(this);
  160. a._hash = this._hash.clone();
  161. return a
  162. },
  163. blockSize: 16,
  164. _createHelper: function (a) {
  165. return function (b, d) {
  166. return a.create(d).finalize(b)
  167. }
  168. },
  169. _createHmacHelper: function (a) {
  170. return function (b, d) {
  171. return g.HMAC.create(a, d).finalize(b)
  172. }
  173. }
  174. });
  175. var g = e.algo = {};
  176. return e
  177. }(Math);
  178. (function (h) {
  179. var i = CryptoJS,
  180. e = i.lib,
  181. f = e.WordArray,
  182. e = e.Hasher,
  183. l = i.algo,
  184. k = [],
  185. o = [];
  186. (function () {
  187. function e(a) {
  188. for (var b = h.sqrt(a), d = 2; d <= b; d++)
  189. if (!(a % d)) return !1;
  190. return !0
  191. }
  192. function f(a) {
  193. return 4294967296 * (a - (a | 0)) | 0
  194. }
  195. for (var b = 2, g = 0; 64 > g;) e(b) && (8 > g && (k[g] = f(h.pow(b, 0.5))), o[g] = f(h.pow(b, 1 / 3)), g++), b++
  196. })();
  197. var m = [],
  198. l = l.SHA256 = e.extend({
  199. _doReset: function () {
  200. this._hash = f.create(k.slice(0))
  201. },
  202. _doProcessBlock: function (e, f) {
  203. for (var b = this._hash.words, g = b[0], a = b[1], j = b[2], d = b[3], c = b[4], h = b[5], l = b[6], k = b[7], n = 0; 64 >
  204. n; n++) {
  205. if (16 > n) m[n] = e[f + n] | 0;
  206. else {
  207. var i = m[n - 15],
  208. p = m[n - 2];
  209. m[n] = ((i << 25 | i >>> 7) ^ (i << 14 | i >>> 18) ^ i >>> 3) + m[n - 7] + ((p << 15 | p >>> 17) ^ (p << 13 | p >>> 19) ^ p >>> 10) + m[n - 16]
  210. }
  211. i = k + ((c << 26 | c >>> 6) ^ (c << 21 | c >>> 11) ^ (c << 7 | c >>> 25)) + (c & h ^ ~c & l) + o[n] + m[n];
  212. p = ((g << 30 | g >>> 2) ^ (g << 19 | g >>> 13) ^ (g << 10 | g >>> 22)) + (g & a ^ g & j ^ a & j);
  213. k = l;
  214. l = h;
  215. h = c;
  216. c = d + i | 0;
  217. d = j;
  218. j = a;
  219. a = g;
  220. g = i + p | 0
  221. }
  222. b[0] = b[0] + g | 0;
  223. b[1] = b[1] + a | 0;
  224. b[2] = b[2] + j | 0;
  225. b[3] = b[3] + d | 0;
  226. b[4] = b[4] + c | 0;
  227. b[5] = b[5] + h | 0;
  228. b[6] = b[6] + l | 0;
  229. b[7] = b[7] + k | 0
  230. },
  231. _doFinalize: function () {
  232. var e = this._data,
  233. f = e.words,
  234. b = 8 * this._nDataBytes,
  235. g = 8 * e.sigBytes;
  236. f[g >>> 5] |= 128 << 24 - g % 32;
  237. f[(g + 64 >>> 9 << 4) + 15] = b;
  238. e.sigBytes = 4 * f.length;
  239. this._process()
  240. }
  241. });
  242. i.SHA256 = e._createHelper(l);
  243. i.HmacSHA256 = e._createHmacHelper(l)
  244. })(Math);
  245. (function () {
  246. var h = CryptoJS,
  247. i = h.enc.Utf8;
  248. h.algo.HMAC = h.lib.Base.extend({
  249. init: function (e, f) {
  250. e = this._hasher = e.create();
  251. "string" == typeof f && (f = i.parse(f));
  252. var h = e.blockSize,
  253. k = 4 * h;
  254. f.sigBytes > k && (f = e.finalize(f));
  255. for (var o = this._oKey = f.clone(), m = this._iKey = f.clone(), q = o.words, r = m.words, b = 0; b < h; b++) q[b] ^= 1549556828, r[b] ^= 909522486;
  256. o.sigBytes = m.sigBytes = k;
  257. this.reset()
  258. },
  259. reset: function () {
  260. var e = this._hasher;
  261. e.reset();
  262. e.update(this._iKey)
  263. },
  264. update: function (e) {
  265. this._hasher.update(e);
  266. return this
  267. },
  268. finalize: function (e) {
  269. var f =
  270. this._hasher,
  271. e = f.finalize(e);
  272. f.reset();
  273. return f.finalize(this._oKey.clone().concat(e))
  274. }
  275. })
  276. })();
  277. module.exports = {
  278. CryptoJS
  279. };