This code will let you convert an arbitrary string with 0s and 1s only into a Hex value, and back. Why? Maybe you have a Javascript component that renders based on a long array of bits. Lets say var b = "101010101100101001000101011101010010011100000010100110000010001010010011000000000001000010101001110000000001100010100000" The string can be stored in the DB as nvarchar(max) field, but then if you want to reduce the length by 1/8th, you can convert it into a Hexadecimal representation The above would be equivalent to 27029822 930010A9C018A0 Ok, this is the 'bit packing' concept implemented in a very crude way. Anyhow, the output is human readable and probably easier to pass in a JSON The functions are as below Private Function bitArrayStrtoHex(b As String) As String Dim sb As New System.Text.StringBuilder For i As Integer = 0 To b.Length - 1 Step 8 Dim cu...
My experiences with Object Oriented Programming