Skip to content

armstrong1972/Go-Struct-To-Bin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go-Struct-byte

The demo of Encode & Decode between Struct & []byte in Go lang.

Result of running :

---- Original : User1 ------
{2323 armstrong password SuperNova [96 96 16 95 184 242 96 35 44 137 179 198] {13839599003027272100 3716401 0x9c7fa0} [96 96 16 95 184 242 96 35 44 137 179 199] {999 [1 2 3 4 5 6 7 8 9 10] [11 22 33 44 55]}}

---- Encoded : []byte ------
[19 9 0 0 0 0 0 0 182 93 147 0 0 0 0 0 9 0 0 0 0 0 0 0 3 91 147 0 0 0 0 0 8 0 0 0 0 0 0 0 146 93 147 0 0 0 0 0 9 0 0 0 0 0 0 0 96 96 16 95 184 242 96 35 44 137 179 198 0 0 0 0 164 113 74 201 247 33 16 192 49 181 56 0 0 0 0 0 160 127 156 0 0 0 0 0 96 96 16 95 184 242 96 35 44 137 179 199 0 0 0 0 231 3 0 0 0 0 0 0 166 64 1 0 192 0 0 0 10 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 65 1 0 192 0 0 0 5 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0]

---- Decoded : User2 -------
&{2323 armstrong password SuperNova [96 96 16 95 184 242 96 35 44 137 179 198] {13839599003027272100 3716401 0x9c7fa0} [96 96 16 95 184 242 96 35 44 137 179 199] {999 [1 2 3 4 5 6 7 8 9 10] [11 22 33 44 55]}}

User1.name= Rainbow @ 0xc00007c000
User2.name= Rainbow @ 0xc00007c000

About

Encode & Decode between Struct & []byte

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages