treat a long number as an array of bytes

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 00:33
Joined
Sep 12, 2006
Messages
16,121
I want to do some encryption. I was thinking of taking a long number, and manipulating the 4 individual bytes of that number in some way.

is there an easy way of treating a number as, say an array of 4 bytes.
 
Last time I worked with encryption, I mainly used strings because I can't otherwise hold a 256-bit SHA hash in hex values. This way, it's also easy to convert between string and byte arrays. This is valid.

Code:
Dim s As String
Dim r As String
Dim b() As Byte

s = "Hello, World!"
b = s
r = b

Debug.Print r
 

Users who are viewing this thread

Back
Top Bottom