Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Base64 VLQ概要

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on.

Base64 VLQ概要

Avatar for rchaser53

rchaser53

June 15, 2017
Tweet

More Decks by rchaser53

Other Decks in Programming

Transcript

  1. 011011 Continuous Bit Value Bit Sign Bit b = 27

    bitには役割が存在する
  2. 011011 Continuous Bit: 0 => 演算不要! Value Bit: 1101 =>

    13 Sign Bit: 1 => -1 b = 27 結果 -13
  3. 100010 Continuous Bit: 1 Value Bit: 0001 Sign Bit: 0

    i = 34 000110 G = 6 Value Bit: 0011
  4. 100010 Continuous Bit: 1 Value Bit: 0001 Sign Bit: 0

    i = 34 次の文字のValue Bit(0011)を左に5bitシフトし 000110 G = 6 Value Bit: 0011 0011 << 5 => 1100000
  5. 100010 Continuous Bit: 1 Value Bit: 0001 Sign Bit: 0

    i = 34 この文字列のValue Bit(0001)との和を取る 1100000 + 0001 = 1100001 => 97 G = 6 Value Bit: 0011 000110
  6. 100010 Continuous Bit: 1 Value Bit: 0001 Sign Bit: 0

    i = 34 Sign Bitは0のため符号は「+」のまま 従ってiG = 97 G = 6 Value Bit: 0011 000110
  7. sources: ["../src/sourcemapTest.ts"] names: [], mappings: "AACA,IAAM,SAAS,...” 1.変換後の列番号 0 => 0

    2.変換前のファイル名のindex 0 => 0 (sourcemapのsectionsのindex) 3.変換前のファイルの行番号 0 => 1 4.変換前のファイルの列番号 0 => 0 5.変換後の単語のindex 0 => 0 (sourcemapのnamesのindex) 例えば以下のようなsourcemapの構成だったら… AACA = 0010
  8. sources: ["../src/sourcemapTest.ts"] names: [], mappings: "AACA,IAAM,SAAS,...” 1.変換後の列番号 0 => 4

    2.変換前のファイル名のindex 0 => 0 (sourcemapのsectionsのindex) 3.変換前のファイルの行番号 1 => 1 4.変換前のファイルの列番号 0 => 6 5.変換後の単語のindex 0 => 0 (sourcemapのnamesのindex) 例えば以下のようなsourcemapの構成だったら… IAAM = 4006
  9. sources: ["../src/sourcemapTest.ts"] names: [], mappings: "AACA,IAAM,SAAS,...” 1.変換後の列番号 4 => 13

    2.変換前のファイル名のindex 0 => 0 (sourcemapのsectionsのindex) 3.変換前のファイルの行番号 1 => 1 4.変換前のファイルの列番号 6 => 15 5.変換後の単語のindex 0 => 0 (sourcemapのnamesのindex) 例えば以下のようなsourcemapの構成だったら… SAAS = 9009
  10. ちなみに何を変換したか? sources: ["../src/sourcemapTest.ts"] names: [], mappings: "AACA,IAAM,SAAS,...” var tempValue =

    123; type TempType = number; const tempValue: TempType = 123; JavaScript TypeScript sourcemap