Personal

You are currently browsing the articles from Information City matching the category Personal.

Dog breeds

Was wandering around to search for dog breed and found and article posted by MNAWF (Malaysian National Animal Welfare Foundation) which list quite a complete number of breeds and their characteristics. For those who are interested to get a dog for guardian (be it house or personal), well it’s good to know what sort of dogs suit you. Take a read if you’re into one before deciding.

To quote one of the dog owner, “Getting a dog must never be a spontaneous decision. It’s just like if you’re planning for a child, you need to think of your living arrangements, your finances, everything. A puppy is a commitment for the next 15 years”.

DogBreeds Characterics.

Written by admin on May 13th, 2012 with no comments.
Read more articles on Personal.

Convert string to MD5 hash

Thought this could be useful in near future, reposting this for my own reference:

‘ calculate the MD5 hash of a given string
‘ the string is first converted to a byte array
Public Function MD5CalcString(ByVal strData As String) As String

Dim objMD5 As New System.Security.Cryptography.MD5CryptoServiceProvider
Dim arrData() As Byte
Dim arrHash() As Byte

‘ first convert the string to bytes (using UTF8 encoding for unicode characters)
arrData = System.Text.Encoding.UTF8.GetBytes(strData)

‘ hash contents of this byte array
arrHash = objMD5.ComputeHash(arrData)

‘ thanks objects
objMD5 = Nothing

‘ return formatted hash
Return ByteArrayToString(arrHash)

End Function

‘ utility function to convert a byte array into a hex string
Private Function ByteArrayToString(ByVal arrInput() As Byte) As String

Dim strOutput As New System.Text.StringBuilder(arrInput.Length)

For i As Integer = 0 To arrInput.Length – 1
strOutput.Append(arrInput(i).ToString(“X2″))
Next

Return strOutput.ToString().ToLower

End Function

Keywords:

Written by admin on January 5th, 2012 with no comments.
Read more articles on Personal and Programming and Web.

« Older articles

No newer articles