{"id":2424,"date":"2013-01-27T01:36:04","date_gmt":"2013-01-27T01:36:04","guid":{"rendered":"http:\/\/enjoyasp.net\/?p=2424"},"modified":"2013-01-27T01:59:10","modified_gmt":"2013-01-27T01:59:10","slug":"base64-vlq-%e7%bc%96%e7%a0%81%e8%a7%84%e5%88%99","status":"publish","type":"post","link":"https:\/\/enjoyasp.net\/index.php\/2013\/01\/27\/base64-vlq-%e7%bc%96%e7%a0%81%e8%a7%84%e5%88%99\/","title":{"rendered":"BASE64 VLQ \u7f16\u7801\u89c4\u5219"},"content":{"rendered":"<p><span style=\"color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px; background-color: rgb(255, 255, 255);\">VLQ \u662f Variable-length quantity \u7684\u7f29\u5199\uff0c\u662f\u4e00\u79cd\u901a\u7528\u7684\uff0c\u4f7f\u7528\u4efb\u610f\u4f4d\u6570\u7684\u4e8c\u8fdb\u5236\u6765\u8868\u793a\u4e00\u4e2a<strong>\u4efb\u610f\u5927\u7684\u6570\u5b57<\/strong>\u7684\u4e00\u79cd\u7f16\u7801\u65b9\u5f0f\u3002\u8fd9\u4e2a\u7f16\u7801\u65b9\u5f0f\u662f\u5728 MIDI \u6587\u4ef6\u683c\u5f0f\u4e2d\u5b9a\u4e49\u7684\uff0c<strong>\u7528\u6765\u8282\u7701\u7a7a\u95f4<\/strong>\u3002<\/span><\/p>\n<p><span style=\"color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px; background-color: rgb(255, 255, 255);\">\u7ebf\u7f16\u7801\u89e3\u7801\u7684\u7f51\u7ad9\uff1a<\/span><a href=\"http:\/\/murzwin.com\/base64vlq.html\" style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(116, 51, 153); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">http:\/\/murzwin.com\/base64vlq.html<\/a><span style=\"color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px; background-color: rgb(255, 255, 255);\">&nbsp;,<br \/>\n\u5f00\u6e90\u5e93\u76f8\u5173\u5b9e\u73b0\uff1a<\/span><a href=\"https:\/\/github.com\/mozilla\/source-map\/blob\/master\/lib\/source-map\/base64-vlq.js\" style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(116, 51, 153); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">https:\/\/github.com\/mozilla\/source-map\/blob\/master\/lib\/source-map\/base64-vlq.js<\/a><span style=\"color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px; background-color: rgb(255, 255, 255);\">,<\/span><\/p>\n<p style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n\t\u9996\u5148\u6211\u4eec\u5148\u6765\u4e86\u89e3\u4e0b VLQ \u662f\u4ec0\u4e48\uff0cVLQ \u662f Variable-length quantity \u7684\u7f29\u5199\uff0c\u662f\u4e00\u79cd\u901a\u7528\u7684\uff0c\u4f7f\u7528\u4efb\u610f\u4f4d\u6570\u7684\u4e8c\u8fdb\u5236\u6765\u8868\u793a\u4e00\u4e2a\u4efb\u610f\u5927\u7684\u6570\u5b57\u7684\u4e00\u79cd\u7f16\u7801\u65b9\u5f0f\u3002\u8fd9\u4e2a\u7f16\u7801\u65b9\u5f0f\u662f\u5728 MIDI \u6587\u4ef6\u683c\u5f0f\u4e2d\u5b9a\u4e49\u7684\uff0c\u7528\u6765\u8282\u7701\u7a7a\u95f4\u3002\u5728\u5176\u4ed6\u5730\u65b9\u4e5f\u6709\u5f88\u591a\u7c7b\u4f3c\u8fd9\u6837\u7684\u7f16\u7801\u683c\u5f0f\uff0c\u6bd4\u5982\u5728 Google&rsquo;s protocol buffers \u4e2d\uff0c\u8fd8\u6709\u6211\u4eec\u9a6c\u4e0a\u8981\u8ba8\u8bba\u5230\u7684 BASE64 VLQ \u4e2d\u3002\u60f3\u4e86\u89e3\u7684\u66f4\u591a\uff0c\u8bf7\u53c2\u8003<a href=\"http:\/\/en.wikipedia.org\/wiki\/Variable-length_quantity\" style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(116, 51, 153); background-position: initial initial; background-repeat: initial initial;\">wikipedia<\/a>\u3002<\/p>\n<p style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n\t\u6211\u4eec\u5148\u6765\u770b\u770b MIDI \u4e2d\u7684 VLQ \u7f16\u7801\u662f\u5982\u4f55\u7f16\u7801 137 \u8fd9\u4e2a\u6570\u5b57\u7684\u5427\uff1a\uff08\u6458\u6284\u81ea wikipedia\uff09<\/p>\n<ul style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px 1.5em; padding: 0px; vertical-align: baseline; list-style: square; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t\u5148\u628a 137 \u8f6c\u6362\u6210\u4e8c\u8fdb\u5236\uff1a10001001<\/li>\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t7 bit \u4e00\u7ec4\uff0c\u628a\u4e8c\u8fdb\u5236\u5206\u5f00\uff0c\u4e0d\u8db3\u7684\u8865 0 \uff0c\u53d8\u6210 0000001 0001001<\/li>\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t\u628a\u6700\u4f4e\u76847\u4f4d\u62ff\u51fa\u6765\uff0c\u5728\u6700\u9ad8\u4f4d\u88650\u8868\u793a\u6700\u540e\u4e00\u4f4d\uff0c\u53d8\u6210 0000 1001\uff0c\u8fd9\u4e2a\u4f5c\u4e3a\u6700\u4f4e\u4f4d\uff0c\u653e\u5728\u6700\u540e\u8fb9\u3002<\/li>\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t\u5728\u5176\u4ed6\u7ec4\u7684\u6700\u9ad8\u4f4d\u8865 1 \uff0c\u8868\u793a\u6ca1\u6709\u7ed3\u675f\uff0c\u540e\u9762\u8ddf\u7740\u8fd8\u6709\u6570\u636e\u3002\u5728\u8fd9\u91cc\u5c31\u662f 1000 0001<\/li>\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t\u62fc\u5728\u4e00\u8d77\uff0c\u5c31\u53d8\u6210\u4e86 1000 0001 0000 1001 .<\/li>\n<\/ul>\n<p style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n\t\u8fd9\u5c31\u662f VLQ \u7684\u53d8\u5316\u8fc7\u7a0b\u3002<\/p>\n<p style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n\t\u90a3\u4e48\u4ec0\u4e48\u662f Base64 VLQ \u5462\uff1f\u548c\u4e0a\u9762\u7684\u53d8\u6362\u8fc7\u7a0b\u6709\u4ec0\u4e48\u533a\u522b\u5462\uff1f<\/p>\n<p style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n\t\u6211\u4eec\u53ef\u4ee5\u5148\u6765\u53c2\u8003\u6211\u535a\u5ba2\u7684\u53e6\u5916\u4e00\u7bc7\u6587\u7ae0\uff0c\u5148\u6765\u56de\u987e\u4e0b Base64 \u7f16\u7801\uff1a<a href=\"http:\/\/blog.allenm.me\/2012\/11\/base64-encoding\/\" style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; color: rgb(116, 51, 153); background-position: initial initial; background-repeat: initial initial;\">BASE64 \u7f16\u7801\u89c4\u5219<\/a><\/p>\n<p style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n\t\u6211\u4eec\u53ef\u4ee5\u770b\u5230 Base64 \u662f\u4e00\u79cd\u53ef\u4ee5\u628a\u4e8c\u8fdb\u5236\u6570\u636e\u7f16\u7801\u6210\u7528 ASCII \u8868\u793a\u7684\u4e00\u79cd\u7f16\u7801\u89c4\u5219\uff0c\u4f46\u662f\u53d7\u9650\u4e8e Base64 \u91c7\u7528\u7684\u5b57\u7b26\u96c6\uff0c\u4e00\u4e2a Base64 \u5b57\u7b26\u53ea\u80fd\u8868\u793a 6bit \u7684\u6570\u636e\u3002\u6240\u4ee5\u4e0a\u9762\u7684 VLQ \u4e2d 7 bit \u4e00\u7ec4\u7684\u5206\u7ec4\u65b9\u5f0f\uff0c\u5728\u8fd9\u91cc\u5c31\u8981\u53d8\u6210 5 bit \u4e00\u7ec4\u7684\u5206\u7ec4\u4e86\u3002<\/p>\n<p style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n\t\u53e6\u5916\uff0cBase64 VLQ \u9700\u8981\u80fd\u591f\u8868\u793a\u8d1f\u6570\uff0c\u4e8e\u662f\u89c4\u5b9a\u4e86\u9700\u8981\u5148\u628a\u6570\u5b57\u53d8\u6210\u65e0\u7b26\u53f7\u6570\uff0c\u7528\u6700\u540e\u4e00\u4f4d\u6765\u4f5c\u4e3a\u7b26\u53f7\u6807\u5fd7\u4f4d\u3002\u6211\u4eec\u76f4\u63a5\u6765\u505a\u4e00\u4e2a\u53d8\u6362\u5427\uff0c\u8fd9\u6837\u7406\u89e3\u7684\u6700\u5feb\u3002\u5728\u4f8b\u5b50\u4e2d\u53ef\u4ee5\u770b\u5230\u548c\u4e0a\u9762\u7684 VLQ \u7f16\u7801\u8fd8\u662f\u6709\u4e00\u5b9a\u5dee\u522b\u7684\u3002<\/p>\n<p style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n\t\u4e0d\u59a8\u8fd8\u62ff 137 \u6765\u505a\u793a\u4f8b\u5427\u3002<\/p>\n<ul style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px 1.5em; padding: 0px; vertical-align: baseline; list-style: square; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t\u5148\u628a 137 \u8f6c\u6362\u6210\u4e8c\u8fdb\u5236\uff1a10001001<\/li>\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t\u7531\u4e8e 137 \u662f\u6b63\u6570\uff0c\u6240\u4ee5\u5728\u6700\u4f4e\u4f4d\u88650 \u53d8\u6210 100010010<\/li>\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t\u6309\u7167 5bit \u4e00\u7ec4\u7684\u65b9\u5f0f\u5206\u7ec4\uff0c\u53d8\u6210 01000 10010<\/li>\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t\u6309\u7167\u4ece\u4f4e\u4f4d\u5230\u9ad8\u4f4d\u7684\u987a\u5e8f\uff0c\u4ee5 5bit \u4e00\u7ec4\u4e3a\u5355\u4f4d\uff0c\u4f9d\u6b21\u62ff\u51fa\u6570\u636e\u505a\u8f6c\u6362\u3002<\/li>\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t\u5148\u62ff\u51fa\u7b2c\u4e00\u7ec4 10010 , \u56e0\u4e3a\u540e\u9762\u8fd8\u6709\u6570\u636e\uff0c\u6240\u4ee5\u9700\u8981\u5728\u9ad8\u4f4d\u8865 1\uff0c\u53d8\u6210 110010 ,\u7f16\u7801\u6210 Base64: y<\/li>\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t\u518d\u62ff\u51fa\u7b2c\u4e8c\u7ec4\uff0c\u4e5f\u662f\u6211\u4eec\u8fd9\u91cc\u7684\u6700\u540e\u4e00\u7ec4\uff0c01000 , \u7531\u4e8e\u662f\u6700\u540e\u4e00\u7ec4\uff0c\u6240\u4ee5\u5728\u9ad8\u4f4d\u8865 0 \u53d8\u6210 001000\uff0c\u7f16\u7801\u6210 Base64: I<\/li>\n<li style=\"background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline; background-position: initial initial; background-repeat: initial initial;\">\n\t\t\u6309\u7167\u4ece\u4f4e\u4f4d\u5230\u9ad8\u4f4d\u7684\u987a\u5e8f\u628a\u8fd9\u4e9b ASCII \u5b57\u7b26\u62fc\u63a5\u8d77\u6765\uff0c\u53d8\u6210 yI<\/li>\n<\/ul>\n<p style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n\t\u53ef\u4ee5\u770b\u5230\u5728 VLQ \u4e2d\uff0c\u7f16\u7801\u987a\u5e8f\u662f\u4ece\u9ad8\u4f4d\u5230\u4f4e\u4f4d\uff0c\u5728 Base64 VLQ \u4e2d\uff0c\u7f16\u7801\u987a\u5e8f\u662f\u4ece\u4f4e\u4f4d\u5230\u9ad8\u4f4d\u3002<\/p>\n<p style=\"background-color: rgb(255, 255, 255); border: 0px; margin: 0px 0px 24px; padding: 0px; vertical-align: baseline; color: rgb(51, 51, 51); font-family: \u5fae\u8f6f\u96c5\u9ed1, \u5b8b\u4f53, Georgia, 'Bitstream Charter', serif; font-size: 16px; line-height: 24px;\">\n\t\u90a3\u4e48\u5982\u4f55\u89e3\u7801\u5462\uff1f\u76f8\u4fe1\u4e86\u89e3\u4e86\u7f16\u7801\u8fc7\u7a0b\u540e\uff0c\u89e3\u7801\u8fc7\u7a0b\u5c31\u4e0d\u5fc5\u518d\u8bb2\u89e3\u4e86\u3002<\/p>\n<p>\t\u53c2\u8003\uff1ahttp:\/\/blog.allenm.me\/2012\/12\/base64-vlq-encoding\/<br \/>\n\thttp:\/\/www.ruanyifeng.com\/blog\/2013\/01\/javascript_source_map.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>VLQ \u662f Variable-length quantity \u7684\u7f29\u5199\uff0c\u662f\u4e00\u79cd\u901a\u7528\u7684\uff0c\u4f7f\u7528\u4efb\u610f\u4f4d\u6570\u7684\u4e8c\u8fdb\u5236\u6765\u8868\u793a [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-2424","post","type-post","status-publish","format-standard","hentry","category-14"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/2424","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/comments?post=2424"}],"version-history":[{"count":0,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/posts\/2424\/revisions"}],"wp:attachment":[{"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/media?parent=2424"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/categories?post=2424"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enjoyasp.net\/index.php\/wp-json\/wp\/v2\/tags?post=2424"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}