📄 cod_numerator.bas
字号:
Attribute VB_Name = "Cod_Numerator"
' **********************************************************************
' 描 述:21种加密54种压缩 算法模块 海阔天空收集整理
' Play78.com : 网站导航,源码之家,绝对开源
' 海阔天空整理,有问题请上www.paly78.com 提
' 网址:http://www.play78.com/
' QQ:13355575
' e-mail:hglai@eyou.com
' **********************************************************************
Option Explicit
'this sub will split up every bytevalue in 1 to 3 codes below 10
'it uses 1 additional byte for the codecount to follow
Public Sub Numerator_EnCoder(ByteArray() As Byte)
Dim OutStream() As Byte
Dim OutPos As Long
Dim NewByte(2) As Byte
Dim ValCount As Integer
Dim X As Long
Dim Y As Integer
Dim Char As String
ReDim OutStream(500)
For X = 0 To UBound(ByteArray)
ValCount = -1
Char = Trim(Str(ByteArray(X)))
Call AddCharToArray(OutStream, OutPos, CByte(Len(Char)))
If Char <> "0" Then
For Y = 1 To Len(Char)
Call AddCharToArray(OutStream, OutPos, Val(Mid(Char, Y, 1)))
Next
End If
Next
ReDim ByteArray(OutPos - 1)
Call CopyMem(ByteArray(0), OutStream(0), OutPos)
End Sub
Public Sub Numerator_DeCoder(ByteArray() As Byte)
Dim InpPos As Long
Dim OutStream() As Byte
Dim OutPos As Long
Dim Char As String
Dim ValCount As Integer
Dim X As Long
ReDim OutStream(500)
Do While InpPos <= UBound(ByteArray)
ValCount = ByteArray(InpPos) - 1
InpPos = InpPos + 1
Char = ""
For X = 0 To ValCount
Char = Char & ByteArray(InpPos)
InpPos = InpPos + 1
Next
Call AddCharToArray(OutStream, OutPos, Val(Char))
Loop
ReDim ByteArray(OutPos - 1)
Call CopyMem(ByteArray(0), OutStream(0), OutPos)
End Sub
'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 + -