亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? comp_reducer.bas

?? 網上收集的多種加密解密以及壓縮算法vb源碼。
?? BAS
字號:
Attribute VB_Name = "Comp_Reducer"


Option Explicit

'This is a 1 run method but we have to keep the whole contents
'in memory until some variables are saved wich are needed bij the decompressor

'This compressor makes use of a dictionary and code the ascii character
'to the position it is located in
'for every character it has to store a header and location
'there are 7 headers which will tell yo the amount of bits to read
'for the location
'example:
'header :   positions
'   0   :   0/1
'   1   :   2/3/4/5
'   2   :   6/7/8/9/10/11/12/13
'   3   :   14/15/16/17/18/19/20/21/22/23/24/25/26/27/28/29
'   etc'etc
'The header will have 1,2 or 3 bits depending on the numbers of chars to compress
'The dictionary is build up from the most common char to the least common char
'if as char must be stored which is the 6'ed most common char in the dictionary
'then the posiotion in the dictionary will be 6 but since we start the
'the value 0 the position will be 6-1=5
'5 will fall within the range of header 1
'so the headerbits will be 001 with will tell us to store 2 bits more
'for the position of the char
'since header 1 start with position 2 we can substract this from the
'actual position 5-2=3 which can be stored in 2 bits 11
'so the code to store the 6'ed character wil be 001 11

Private Type BytePos
    Data() As Byte
    Position As Long
    Buffer As Integer
    BitPos As Integer
End Type
Private Stream(1) As BytePos    '0=control 1=BitStreams

Private Dictionary As String
Private BitsForHeader As Integer   '1=max 6 chars  2=max 30 chars  3=more then 30 chars

Private Sub Init_Reducer()
    Dim X As Byte
'   controller bits 000-111 for 1 to 8 which tel the numbers of bits to read
'   bits to store
'   2 * 1 bit
'   4 * 2 bits
'   2^? bits * ? bits
'
'   Ascii table can be stored in
'   2*1+4*2+8*3+16*4+32*5+64*6+128*7+2*8 bits + 256 * 3 controlerbits
    Select Case Len(Dictionary)
        Case Is < 7
            BitsForHeader = 1
        Case Is < 30
            BitsForHeader = 2
        Case Else
            BitsForHeader = 3
    End Select
'Init the output stream
    For X = 0 To 1
        ReDim Stream(X).Data(500)
        Stream(X).BitPos = 0
        Stream(X).Buffer = 0
        Stream(X).Position = 0
    Next
End Sub

Public Sub Compress_Reducer(ByteArray() As Byte)
    Dim X As Long
    Dim Y As Long
    Dim NoMore As Boolean
    Dim Most As Long
    Dim NewFileLen As Long
    Dim Nuchar As Byte
    Dim CharCount(255) As Long
'firts whe start looking for the most frequent characters
    For X = 0 To UBound(ByteArray)
        CharCount(ByteArray(X)) = CharCount(ByteArray(X)) + 1
    Next
    NoMore = False
    Dictionary = ""
    Do While NoMore = False
        NoMore = True
        Most = 0
        For X = 0 To 255
            If CharCount(X) > 0 Then
                If CharCount(X) > Most Then
                    Most = CharCount(X)
                    Nuchar = X
                    NoMore = False
                End If
            End If
        Next
'and store it in the dictionary
        If NoMore = False Then
            Dictionary = Dictionary & Chr(Nuchar)
            CharCount(Nuchar) = 0
        End If
    Loop
'init the local variabels
    Call Init_Reducer
'after whe have don that whe only read the stream and convert them to bitstreams
    For X = 0 To UBound(ByteArray)
        Call AddValueToStream(CInt(ByteArray(X)))
    Next
'send the EOF-marker
    Call AddValueToStream(256)
'lets fill the leftovers
    For X = 0 To 1
        Do While Stream(X).BitPos > 0
            Call AddBitsToStream(Stream(X), 0, 1)
        Loop
    Next
'Lets restore the bounderies
    For X = 0 To 1
        ReDim Preserve Stream(X).Data(Stream(X).Position - 1)
    Next
'whe calculate the new length of the new data
    NewFileLen = Len(Dictionary)
    For X = 0 To 1
        NewFileLen = NewFileLen + UBound(Stream(X).Data) + 1
    Next
    ReDim ByteArray(NewFileLen + 6)
'Whe store the dictionary (What a waste) but whe need it for decoding
    NewFileLen = 0
    ByteArray(NewFileLen) = Len(Dictionary) - 1
    NewFileLen = NewFileLen + 1
    For X = 1 To Len(Dictionary)
        ByteArray(NewFileLen) = ASC(Mid(Dictionary, X, 1))
        NewFileLen = NewFileLen + 1
    Next
'Store the start position of the different streams
    For X = 0 To 0
        ByteArray(NewFileLen) = Int(UBound(Stream(X).Data) / &H10000) And &HFF
        NewFileLen = NewFileLen + 1
        ByteArray(NewFileLen) = Int(UBound(Stream(X).Data) / &H100) And &HFF
        NewFileLen = NewFileLen + 1
        ByteArray(NewFileLen) = UBound(Stream(X).Data) And &HFF
        NewFileLen = NewFileLen + 1
    Next
'Combine the streams into one output stream
    For X = 0 To 1
        For Y = 0 To UBound(Stream(X).Data)
            ByteArray(NewFileLen) = Stream(X).Data(Y)
            NewFileLen = NewFileLen + 1
        Next
    Next
End Sub

Public Sub DeCompress_Reducer(ByteArray() As Byte)
    Dim OutStream() As Byte
    Dim OutPos As Long
    Dim InposCont As Long
    Dim InContBit As Integer
    Dim InposData As Long
    Dim InDataBit As Integer
    Dim Char As Integer
    Dim Numbits As Integer
    Dim X As Long
    ReDim OutStream(500)
    Dictionary = ""
    InposCont = 1
'Read the dictionary
    For X = 0 To ByteArray(0)
        Dictionary = Dictionary & Chr(ByteArray(InposCont))
        InposCont = InposCont + 1
    Next
    InposData = 0
'Read the starting points of the different streams
    For X = 0 To 2
        InposData = CLng(InposData) * 256 + ByteArray(InposCont)
        InposCont = InposCont + 1
    Next
    InposData = InposData + InposCont + 1
'init the reducer starting codes
    Call Init_Reducer
    InContBit = 0
    InDataBit = 0
    OutPos = 0
'start decompressing the data
    Do
'read the header bits
        Numbits = ReadBitsFromArray(ByteArray, InposCont, InContBit, BitsForHeader) + 1
'read the position bits
        Char = ReadBitsFromArray(ByteArray, InposData, InDataBit, Numbits)
'translate header and positionbits to ascii code
        Char = ExpanderBits(Numbits, Char)
'exit if EOF-code
        If Char = 256 Then Exit Do
'store the code into the output stream
        Call AddCharToArray(OutStream, OutPos, CByte(Char))
    Loop
'copy the output into the input to return it to the caller
    ReDim ByteArray(OutPos - 1)
    For X = 0 To OutPos - 1
        ByteArray(X) = OutStream(X)
    Next
End Sub

'this function translate an ascii code into a header and dict. position
Private Function ReducerBits(Char As Integer) As Integer
    Dim DiPos As Integer
    Dim TotPos As Integer
    Dim Y As Integer
    If Char = 256 Then ReducerBits = 8: Char = 255: Exit Function
    DiPos = InStr(Dictionary, Chr(Char)) - 1
    For Y = 1 To 8
        If DiPos >= TotPos And DiPos < TotPos + 2 ^ Y Then
            ReducerBits = Y
            Char = DiPos - TotPos
            Exit Function
        End If
        TotPos = TotPos + 2 ^ Y
    Next
End Function

'this function translate a header and dict.position into an ascii code
Private Function ExpanderBits(BitsNum As Integer, BytePos As Integer) As Integer
    If BitsNum = 8 And BytePos = 255 Then ExpanderBits = 256: Exit Function
    Dim TotPos As Integer
    Dim Y As Integer
    For Y = 1 To BitsNum - 1
        TotPos = TotPos + 2 ^ Y
    Next
    ExpanderBits = ASC(Mid(Dictionary, TotPos + BytePos + 1, 1))
End Function

Private Sub AddValueToStream(Number As Integer)
    Dim BitsDeep As Integer
    BitsDeep = ReducerBits(Number)
    Call AddBitsToStream(Stream(0), BitsDeep - 1, BitsForHeader)
    Call AddBitsToStream(Stream(1), Number, BitsDeep)
End Sub

'this sub will add an amount of bits to a sertain stream
Private Sub AddBitsToStream(Toarray As BytePos, Number As Integer, Numbits As Integer)
    Dim X As Long
    If Numbits = 8 And Toarray.BitPos = 0 Then
        If Toarray.Position > UBound(Toarray.Data) Then ReDim Preserve Toarray.Data(Toarray.Position + 500)
        Toarray.Data(Toarray.Position) = Number And &HFF
        Toarray.Position = Toarray.Position + 1
        Exit Sub
    End If
    For X = Numbits - 1 To 0 Step -1
        Toarray.Buffer = Toarray.Buffer * 2 + (-1 * ((Number And 2 ^ X) > 0))
        Toarray.BitPos = Toarray.BitPos + 1
        If Toarray.BitPos = 8 Then
            If Toarray.Position > UBound(Toarray.Data) Then ReDim Preserve Toarray.Data(Toarray.Position + 500)
            Toarray.Data(Toarray.Position) = Toarray.Buffer
            Toarray.BitPos = 0
            Toarray.Buffer = 0
            Toarray.Position = Toarray.Position + 1
        End If
    Next
End Sub

'this function will return a value out of the amaunt of bits you asked for
Private Function ReadBitsFromArray(FromArray() As Byte, FromPos As Long, FromBit As Integer, Numbits As Integer) As Long
    Dim X As Integer
    Dim Temp As Long
    For X = 1 To Numbits
        Temp = Temp * 2 + (-1 * ((FromArray(FromPos) And 2 ^ (7 - FromBit)) > 0))
        FromBit = FromBit + 1
        If FromBit = 8 Then
            If FromPos + 1 > UBound(FromArray) Then
                Do While X < Numbits
                    Temp = Temp * 2
                    X = X + 1
                Loop
                FromPos = FromPos + 1
                Exit For
            End If
            FromPos = FromPos + 1
            FromBit = 0
        End If
    Next
    ReadBitsFromArray = Temp
End Function

'this sub will add a char into the outputstream
Private Sub AddCharToArray(Toarray() As Byte, ToPos As Long, Char As Byte)
    If ToPos > UBound(Toarray) Then ReDim Preserve Toarray(ToPos + 500)
    Toarray(ToPos) = Char
    ToPos = ToPos + 1
End Sub

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品资源网站| 欧美日韩国产精品自在自线| 99久久久国产精品| 欧美一区二区二区| 亚洲视频一区二区在线| 麻豆精品国产91久久久久久| 波多野结衣在线aⅴ中文字幕不卡 波多野结衣在线一区 | 国产精品色噜噜| 石原莉奈在线亚洲二区| 99re在线视频这里只有精品| 亚洲精品一区二区在线观看| 亚洲国产日韩一级| 99re热这里只有精品免费视频| 精品国产乱码久久久久久夜甘婷婷| 亚洲精品国产一区二区三区四区在线| 国产真实乱偷精品视频免| 欧美日韩一区三区| 亚洲色图丝袜美腿| 成人午夜视频免费看| 精品欧美一区二区久久| 日本亚洲天堂网| 欧美三级一区二区| 一区二区三区视频在线看| 成人性生交大片免费看中文| 久久婷婷成人综合色| 理论电影国产精品| 亚洲精品国久久99热| 成人免费高清视频在线观看| 亚洲精品一区二区三区精华液| 日韩国产欧美在线播放| 欧美人妖巨大在线| 视频一区欧美精品| 欧美福利视频一区| 日韩一区精品字幕| 精品一区二区三区在线播放| 日韩亚洲欧美一区二区三区| 亚洲欧洲www| 成人国产亚洲欧美成人综合网 | 久久精品99国产精品日本| 欧美日韩精品欧美日韩精品一 | 国产色一区二区| 国产九色sp调教91| 久久精品欧美日韩精品| 国产高清一区日本| 日韩美女视频一区| 欧洲一区在线电影| 午夜精品一区二区三区免费视频| 欧美三级蜜桃2在线观看| 视频一区二区三区入口| 91精品国产91热久久久做人人| 免费观看在线综合色| 久久综合国产精品| www.亚洲精品| 亚洲成人动漫在线观看| 欧美一级淫片007| 国产精品亚洲视频| 国产精品美女久久久久aⅴ国产馆| 丁香激情综合五月| 一区二区三区日韩在线观看| 欧美精品乱码久久久久久| 九九九精品视频| 国产精品久久久久久久浪潮网站| 在线观看免费成人| 精品一区二区三区久久| 国产精品久久福利| 欧美日韩久久久一区| 极品少妇xxxx精品少妇| 亚洲人精品一区| 日韩一级大片在线观看| 成人教育av在线| 视频在线观看一区二区三区| 久久久九九九九| 欧美午夜精品理论片a级按摩| 久久精品72免费观看| 中文字幕亚洲成人| 欧美成人一区二区三区在线观看| 处破女av一区二区| 日韩成人av影视| 亚洲欧洲精品一区二区精品久久久| 欧美影院一区二区| 岛国一区二区在线观看| 日本美女一区二区三区视频| 亚洲少妇30p| 久久久午夜精品| 欧美性生活大片视频| 国产a久久麻豆| 麻豆久久久久久| 亚洲黄网站在线观看| 国产欧美日韩不卡免费| 欧美一区二区三区在线观看视频| 成人福利电影精品一区二区在线观看| 天天色图综合网| 亚洲精品国产一区二区三区四区在线| 久久久亚洲欧洲日产国码αv| 欧美日韩国产天堂| 色婷婷一区二区| 高清成人在线观看| 国产自产v一区二区三区c| 亚洲国产精品久久久久秋霞影院 | 日韩欧美色电影| 欧美日韩亚洲综合| 91网站在线观看视频| 国产一区二区三区四| 久久精品国产澳门| 三级成人在线视频| 亚洲成在人线免费| 亚洲午夜久久久久久久久电影网| 国产精品久久二区二区| 国产精品三级av| 日本一区二区三区电影| 久久精品人人做| 亚洲成人动漫在线免费观看| 一区二区三区视频在线看| 一区二区三区在线视频免费观看| 国产午夜精品一区二区三区嫩草| 精品av久久707| 久久这里只精品最新地址| 亚洲精品一区二区三区香蕉| 久久久亚洲国产美女国产盗摄| 日韩精品影音先锋| 久久亚洲精品小早川怜子| www日韩大片| 日本一区二区三区电影| 欧美韩国日本不卡| 中文字幕第一页久久| 自拍偷拍亚洲欧美日韩| 亚洲欧美日韩成人高清在线一区| 亚洲美腿欧美偷拍| 亚洲宅男天堂在线观看无病毒| 亚洲国产sm捆绑调教视频| 午夜电影网亚洲视频| 青青草原综合久久大伊人精品优势| 日本不卡1234视频| 国产一区二三区| 99国产精品国产精品毛片| 色婷婷av一区二区三区之一色屋| 欧美视频你懂的| 欧美一区二区三区的| ww久久中文字幕| 亚洲欧美日韩中文字幕一区二区三区| 一级精品视频在线观看宜春院 | 国产精品白丝在线| 亚洲精品国产无套在线观| 午夜激情一区二区三区| 国产在线日韩欧美| 色悠久久久久综合欧美99| 欧美日韩亚洲丝袜制服| 久久亚洲精精品中文字幕早川悠里| 国产精品久久久久四虎| 天天综合色天天综合色h| 国产精品69毛片高清亚洲| 色综合久久久久综合99| 91精品国产综合久久香蕉麻豆| 久久亚洲精品国产精品紫薇| 怡红院av一区二区三区| 国内精品国产成人| 欧美在线影院一区二区| 久久日韩精品一区二区五区| 亚洲免费电影在线| 精品一区二区在线观看| 日本道精品一区二区三区 | 久久爱另类一区二区小说| 粉嫩av一区二区三区粉嫩| 欧美日韩在线亚洲一区蜜芽| 欧美国产精品一区二区| 日日噜噜夜夜狠狠视频欧美人 | 色综合激情五月| 久久精品免费在线观看| 视频一区国产视频| 一本到一区二区三区| 久久精品夜色噜噜亚洲aⅴ| 午夜不卡在线视频| av中文字幕在线不卡| 精品国产91乱码一区二区三区| 亚洲精品视频观看| 成人网男人的天堂| 精品国产乱码久久久久久夜甘婷婷| 一区二区三国产精华液| 成人动漫在线一区| 国产亚洲欧美激情| 久久er精品视频| 欧美一级精品在线| 亚洲成a人片综合在线| 色屁屁一区二区| 国产精品另类一区| 国产成人av一区二区三区在线| 日韩精品一区在线观看| 午夜欧美大尺度福利影院在线看| 97久久精品人人做人人爽50路| 国产夜色精品一区二区av| 国产在线精品不卡| 26uuu久久综合| 精品一区二区三区免费视频| 日韩视频不卡中文| 奇米888四色在线精品| 3atv在线一区二区三区| 日韩精品视频网站| 欧美一区二区三区免费观看视频 | 91麻豆精品国产自产在线| 亚洲一级二级三级在线免费观看|