{"id":1925,"date":"2013-11-08T09:23:05","date_gmt":"2013-11-08T00:23:05","guid":{"rendered":"https:\/\/www.united-bears.co.jp\/blog\/?p=1925"},"modified":"2013-11-08T09:23:05","modified_gmt":"2013-11-08T00:23:05","slug":"%e3%83%8f%e3%83%83%e3%82%b7%e3%83%a5%e5%80%a4%e7%94%9f%e6%88%90","status":"publish","type":"post","link":"https:\/\/www.united-bears.co.jp\/blog\/archives\/1925","title":{"rendered":"\u30cf\u30c3\u30b7\u30e5\u5024\u751f\u6210"},"content":{"rendered":"<p><script type=\"text\/javascript\" src=\"\/blog\/wp-includes\/js\/jquery\/jquery.js\"><\/script><br \/>\n<script type=\"text\/javascript\">\njQuery(document).ready(function() {\n\/\/ fix wordpress ampersand translation\nfunction logicalAnd(m, n, d) {\nreturn ~(~m | ~n);\n}\nvar HASH_TYPE = { md5: 'MD5', sha1: 'SHA-1'};\njQuery('#create_hash').click(function() {\nvar keyword = jQuery('#keyword').val();\nvar hash_type = jQuery('#hash_type').val();\nvar r = '';\neval('r = hash.' + hash_type + '(\\'' + keyword + '\\');');\njQuery('#result').val(r);\n});\nhash = new function() {\nvar BLOCK_LEN = 64;\n\/\/ Common\nvar fromLittleEndian32 = function(d) {\nvar r = [];\nfor(var i = 0; i < d.length; i++) {\nvar tmp = d[i];\nr.push(logicalAnd(tmp, 0xff));\nr.push(logicalAnd((tmp >>>  8), 0xff));\nr.push(logicalAnd((tmp >>> 16), 0xff));\nr.push(logicalAnd((tmp >>> 24), 0xff));\n}\nreturn r;\n};\nvar toLittleEndian32 = function(d) {\nvar r = [];\nfor(var i = 0; i < d.length; i+=4) {\nr.push((d[i + 3] << 24) | (d[i + 2] << 16) | (d[i + 1] << 8) | d[i]);\n}\nreturn r;\n}\nvar fromBigEndian32 = function(d) {\nvar r = [];\nfor(var i = 0; i < d.length; i++) {\nr.push(logicalAnd((d[i] >>> 24), 0xff));\nr.push(logicalAnd((d[i] >>> 16), 0xff));\nr.push(logicalAnd((d[i] >>>  8), 0xff));\nr.push(logicalAnd(d[i], 0xff));\n}\nreturn r;\n};\nvar toBigEndian32 = function(d) {\nvar r = [];\nfor(var i = 0; i < d.length; i+=4) {\nr.push((d[i] << 24) | (d[i + 1] << 16) | (d[i + 2] << 8) | d[i + 3]);\n}\nreturn r;\n};\nvar unpack = function(d) {\nvar r = [];\nfor(var i = 0; i < d.length; i++) {\nvar code = d.charCodeAt(i);\nif(code <= 0xff) {\nr.push(code);\n} else {\nr.push(code >>> 8);\nr.push(logicalAnd(code, 0xff));\n}\n}\nreturn r;\n}\nvar toHex = function(d) {\nvar r = '';\nfor(var i = 0; i < d.length; i++) {\nr += (d[i] > 0xf ? \"\" : \"0\") + d[i].toString(16);\n}\nreturn r;\n}\n\/\/ MD5\nthis.md5 = function(data) {\nvar STATE = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476 ];\nvar K = [\n0,  1,  2,  3,  4,  5,  6,  7,    8,  9, 10, 11, 12, 13, 14, 15, \n1,  6, 11,  0,  5, 10, 15,  4,    9, 14,  3,  8, 13,  2,  7, 12, \n5,  8, 11, 14,  1,  4,  7, 10,   13,  0,  3,  6,  9, 12, 15,  2, \n0,  7, 14,  5, 12,  3, 10,  1,    8, 15,  6, 13,  4, 11,  2,  9 \n];\nvar S = [\n7, 12, 17, 22,  7, 12, 17, 22,    7, 12, 17, 22,  7, 12, 17, 22, \n5,  9, 14, 20,  5,  9, 14, 20,    5,  9, 14, 20,  5,  9, 14, 20, \n4, 11, 16, 23,  4, 11, 16, 23,    4, 11, 16, 23,  4, 11, 16, 23, \n6, 10, 15, 21,  6, 10, 15, 21,    6, 10, 15, 21,  6, 10, 15, 21 \n];\nvar T = [\n0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,   0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, \n0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,   0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, \n0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,   0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8, \n0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,   0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, \n0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c,   0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, \n0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05,   0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, \n0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039,   0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, \n0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,   0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391 \n];\nvar paddingData = function(d) {\nvar dataLength = d.length;\nvar n = dataLength;\nd[n++] = 0x80;\nwhile(n % BLOCK_LEN != 56) {\nd[n++] = 0x00;\n}\ndataLength *= 8;\nreturn d.concat(fromLittleEndian32([dataLength]), 0, 0, 0, 0);\n};\nvar round = function(d) {\nvar _state = STATE.concat();\nvar tmpState = [];\nfor(var i = 0; i < d.length; i+=BLOCK_LEN) {\ntmpState = _state.concat();\nvar x = toLittleEndian32(d.slice(i, i + BLOCK_LEN));\nfor(var j = 0; j < 64; j++) {\nvar tmp;\nif(j < 16) {\ntmp = (logicalAnd(_state[1], _state[2])) | (logicalAnd(~_state[1], _state[3]));\n} else if(j < 32) {\ntmp = (logicalAnd(_state[1], _state[3])) | (logicalAnd(_state[2], ~_state[3]));\n} else if(j < 48) {\ntmp = _state[1] ^ _state[2] ^ _state[3];\n} else {\ntmp = _state[2] ^ (_state[1] | ~_state[3]);\n}\ntmp += x[K[j]] + T[j] + _state[0];\n_state[0] = _state[1] + ((tmp << S[j]) | (tmp >>> (32 - S[j])));\n_state = [_state[3], _state[0], _state[1], _state[2]];\n}\nfor(var j = 0; j < STATE.length; j++) {\n_state[j] += tmpState[j];\n}\n}\nreturn fromLittleEndian32(_state);\n};\nvar r = '';\nr = unpack(data);\nr = paddingData(r);\nr = round(r);\nreturn toHex(r);\n};\n\/\/ SHA-1\nthis.sha1 = function(data) {\nvar K = [ 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xca62c1d6 ];\nvar STATE = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];\nvar rotl = function(_v, _s) { return (_v << _s) | (_v >>> (32 - _s)) };\nvar round = function(d) {\nvar _state = STATE.concat();\nvar tmpState = [];\nvar tmp\nfor(var i = 0; i < d.length; i+=BLOCK_LEN) {\ntmpState = _state.concat();\nvar x = toBigEndian32(d.slice(i, i + BLOCK_LEN));\nfor(var j = 16; j < 80; j++) {\nx[j] = rotl(x[j - 3] ^ x[j - 8] ^ x[j - 14] ^ x[j - 16], 1);\n}\nfor(var j = 0; j < 80; j++) {\nvar tmp;\nif(j < 20) {\ntmp = ((logicalAnd(_state[1], _state[2])) ^ (logicalAnd(~_state[1], _state[3]))) + K[0];\n} else if(j < 40) {\ntmp = (_state[1] ^ _state[2] ^ _state[3]) + K[1];\n} else if (j < 60) {\ntmp = ((logicalAnd(_state[1], _state[2])) ^ (logicalAnd(_state[1], _state[3])) ^ (logicalAnd(_state[2] , _state[3]))) + K[2];\n} else {\ntmp = (_state[1] ^ _state[2] ^ _state[3]) + K[3];\n}\ntmp += rotl(_state[0], 5) + x[j] + _state[4];\n_state[4] = _state[3];\n_state[3] = _state[2];\n_state[2] = rotl(_state[1], 30);\n_state[1] = _state[0];\n_state[0] = tmp;\n}\nfor(var j = 0; j < STATE.length; j++) {\n_state[j] += tmpState[j];\n}\n}\nreturn fromBigEndian32(_state);\n};\nvar paddingData = function(d) {\nvar dataLength = d.length;\nvar n = dataLength;\nd[n++] = 0x80;\nwhile(n % BLOCK_LEN != 56) {\nd[n++] = 0x00;\n}\ndataLength *= 8;\nreturn d.concat(0, 0, 0, 0, fromBigEndian32([dataLength]));\n};\nvar r = '';\nr = unpack(data);\nr = paddingData(r);\nr = round(r);\nreturn toHex(r);\n};\n};\n});\n<\/script><br \/>\n\u30cf\u30c3\u30b7\u30e5\u5024(<strong>MD5<\/strong>\u3001<strong>SHA-1<\/strong>\u306a\u3069)\u3092\u751f\u6210\u3059\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002<\/p>\n<h2>\u30cf\u30c3\u30b7\u30e5\u5024\u751f\u6210<\/h2>\n<p><strong>\u5165\u529b\u6587\u5b57\u5217<\/strong><br \/>\n<input type=\"text\" id=\"keyword\" size=\"65\" maxlength=\"64\" \/><\/p>\n<p><select id=\"hash_type\"><option value=\"md5\">MD5<\/option><option value=\"sha1\">SHA-1<\/option><\/select><br \/>\n<input type=\"button\" value=\"\u30cf\u30c3\u30b7\u30e5\u751f\u6210\" id=\"create_hash\" \/><\/p>\n<p><strong>\u30cf\u30c3\u30b7\u30e5\u5024<\/strong><br \/>\n<input type=\"text\" id=\"result\" size=\"65\" maxlength=\"64\" readonly=\"readonly\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30cf\u30c3\u30b7\u30e5\u5024(MD5\u3001SHA-1\u306a\u3069)\u3092\u751f\u6210\u3059\u308b\u30c4\u30fc\u30eb\u3067\u3059\u3002 \u30cf\u30c3\u30b7\u30e5\u5024\u751f\u6210 \u5165\u529b\u6587\u5b57\u5217 MD5SHA-1 \u30cf\u30c3\u30b7\u30e5\u5024<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-1925","post","type-post","status-publish","format-standard","hentry","category-tools"],"_links":{"self":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1925","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/comments?post=1925"}],"version-history":[{"count":10,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1925\/revisions"}],"predecessor-version":[{"id":1936,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/posts\/1925\/revisions\/1936"}],"wp:attachment":[{"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/media?parent=1925"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/categories?post=1925"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.united-bears.co.jp\/blog\/wp-json\/wp\/v2\/tags?post=1925"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}