亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
午夜免费欧美电影| 中文字幕av资源一区| 亚洲综合色视频| 色欧美日韩亚洲| 亚洲bdsm女犯bdsm网站| 欧美美女黄视频| 久久不见久久见中文字幕免费| 欧美一区二区日韩一区二区| 美女免费视频一区| 国产欧美一区二区精品秋霞影院| 波波电影院一区二区三区| 1024成人网色www| 欧美日韩在线播放一区| 婷婷激情综合网| 久久久久久久综合日本| 成人午夜在线免费| 一区二区高清在线| 日韩免费视频一区二区| 成人精品视频一区二区三区 | 在线视频欧美精品| 日韩成人午夜精品| 国产亚洲一本大道中文在线| 99国产精品一区| 日本大胆欧美人术艺术动态| 久久久久久久久蜜桃| 色综合久久中文字幕| 免费人成黄页网站在线一区二区| 国产亚洲污的网站| 2024国产精品视频| 不卡av电影在线播放| 午夜影视日本亚洲欧洲精品| 国产欧美一区二区三区鸳鸯浴| 色婷婷精品大在线视频| 精品一区二区三区视频| 亚洲精品高清在线观看| 日韩精品一区二区三区蜜臀| 91亚洲国产成人精品一区二区三| 免费看欧美美女黄的网站| 国产精品久久久久久久久动漫 | 丰满岳乱妇一区二区三区| 亚洲妇女屁股眼交7| 久久中文字幕电影| 欧美日韩你懂得| 不卡电影免费在线播放一区| 另类小说综合欧美亚洲| 亚洲男人电影天堂| 久久久.com| 日韩一本二本av| 欧美午夜电影网| 成人精品免费视频| 黄色日韩三级电影| 首页国产丝袜综合| 亚洲精选视频免费看| 国产亲近乱来精品视频| 精品少妇一区二区三区在线视频| 欧美视频一二三区| www..com久久爱| 国产成人精品免费一区二区| 蜜臀99久久精品久久久久久软件| 亚洲一区二区三区爽爽爽爽爽| 国产精品乱人伦一区二区| 久久一区二区视频| 欧美电影免费观看高清完整版在线观看| 91女人视频在线观看| 成人性生交大片| 国产成人啪午夜精品网站男同| 精品在线一区二区| 蜜乳av一区二区| 日韩不卡手机在线v区| 亚洲电影在线免费观看| 亚洲精品一二三区| 亚洲蜜桃精久久久久久久| 亚洲国产高清aⅴ视频| 中文在线一区二区| 国产色91在线| 国产精品美女www爽爽爽| 国产亚洲精久久久久久| 日韩二区在线观看| 亚洲国产精品久久一线不卡| 亚洲一区日韩精品中文字幕| 一区二区高清视频在线观看| 一区二区视频在线看| 一区二区三区在线观看视频| 一区二区理论电影在线观看| 夜夜精品视频一区二区| 午夜视频一区在线观看| 免费人成在线不卡| 精品综合免费视频观看| 国产91丝袜在线播放| caoporn国产一区二区| 91麻豆福利精品推荐| 在线观看视频91| 欧美精品丝袜久久久中文字幕| 宅男噜噜噜66一区二区66| 日韩视频在线永久播放| 久久久亚洲午夜电影| 国产精品网站导航| 一区二区三区四区激情| 五月天网站亚洲| 狠狠色狠狠色综合系列| 岛国精品在线播放| 日本高清免费不卡视频| 欧美人与禽zozo性伦| 欧美成人一区二区三区片免费| 久久久三级国产网站| 亚洲人成电影网站色mp4| 亚洲第一在线综合网站| 狠狠色2019综合网| www.日韩在线| 欧美一区二区三区免费视频| 久久久久99精品国产片| 综合久久久久综合| 五月激情丁香一区二区三区| 国产自产2019最新不卡| 欧美在线免费播放| 久久先锋影音av| 一区二区三区日韩欧美| 久久精品国产秦先生| voyeur盗摄精品| 日韩女优电影在线观看| 国产精品久久久久影视| 亚洲成av人片在www色猫咪| 国产美女在线精品| 欧美色图12p| 国产精品少妇自拍| 日本欧洲一区二区| 色婷婷亚洲精品| 久久久亚洲欧洲日产国码αv| 一区二区三区四区av| 国产成人免费视频一区| 欧美日韩国产美| 中文字幕在线一区免费| 麻豆一区二区99久久久久| 91在线视频免费观看| 精品日韩一区二区三区| 亚洲国产美国国产综合一区二区| 国产精品99久久久| 宅男在线国产精品| 亚洲精品乱码久久久久久黑人| 激情欧美一区二区三区在线观看| 欧美亚洲尤物久久| 国产精品美女久久久久av爽李琼| 久久国产精品72免费观看| 欧美日韩一区小说| 亚洲视频免费看| 成人精品小蝌蚪| 久久亚洲欧美国产精品乐播 | 日韩中文字幕91| jiyouzz国产精品久久| 欧美大片日本大片免费观看| 午夜伦欧美伦电影理论片| 97精品电影院| 国产精品美女久久久久久2018| 国产一区二区三区在线观看免费视频 | 91视频xxxx| 国产精品久久看| 国产成人午夜高潮毛片| 久久久久久久综合色一本| 精品一区二区三区在线视频| 欧美电影免费观看高清完整版| 日韩av在线免费观看不卡| 欧美色成人综合| 亚洲午夜在线电影| 欧美色倩网站大全免费| 亚洲第一av色| 欧美二区三区91| 日韩一区精品视频| 在线综合亚洲欧美在线视频| 日韩不卡一二三区| 日韩精品一区二区三区蜜臀| 男人的天堂久久精品| 日韩一区二区三区四区| 蜜臀99久久精品久久久久久软件| 欧美一区二区三区免费观看视频 | 日本在线播放一区二区三区| 在线91免费看| 91久久奴性调教| 亚洲综合小说图片| 欧美日韩国产在线观看| 欧美aaaaa成人免费观看视频| 日韩女优毛片在线| 国产高清在线精品| 国产精品久久久久aaaa樱花| 91香蕉视频污在线| 亚洲成人精品一区二区| 日韩一区二区三区在线| 国产乱码字幕精品高清av| 国产欧美一区二区精品性| 成人视屏免费看| 亚洲一二三区不卡| 日韩一级精品视频在线观看| 狠狠色丁香婷综合久久| 国产精品国产三级国产aⅴ中文| 色域天天综合网| 日韩av电影天堂| 欧美韩国一区二区| 欧美午夜在线观看| 久久精品国产99久久6| 中文字幕第一区综合| 欧美亚洲尤物久久|