cod_adddiffer.bas

来自「54种加密解密模块 54种加密解密模块 54种加密解密模块」· BAS 代码 · 共 33 行

BAS
33
字号
Attribute VB_Name = "Cod_AddDiffer"




Option Explicit

Public Sub AddDiffer_Coder(ByteArray() As Byte)
    Dim X As Long
    Dim Value As Integer
    Value = 0
    For X = 0 To UBound(ByteArray)
        Value = Value + ByteArray(X)
        If Value > 255 Then Value = Value - 256
        ByteArray(X) = Value
    Next
End Sub

Public Sub AddDiffer_DeCoder(ByteArray() As Byte)
    Dim X As Long
    Dim Value As Integer
    Dim newValue As Integer
    newValue = 0
    For X = 0 To UBound(ByteArray)
        Value = newValue
        newValue = ByteArray(X)
        Value = ByteArray(X) - Value
        If Value < 0 Then Value = Value + 256
        ByteArray(X) = Value
    Next
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?