Ed The Dev .com

Edward Delaporte's Technical Journal

Standard Library Bingo

no comment

As Google gets worse and worse at seeing through spam to identify standard libraries, I find it compelling to create a cheat sheet. Be sure to check the ‘last updated’ date on this post before you decide to use it. If this hasn’t been updated in awhile (because I’ve joined the first colony ship on it’s way to Alpha Centauri), you may want to look for a more recent version.

Convert a string into bytes
Java – String.getBytes(“US-ASCII” or “UTF-8″)
C#
System.Text.UTF8Encoding stringToBytes = new System.Text.UTF8Encoding();
Byte[] inputBytes = stringToBytes.GetBytes(input);
Check Endian-ness of your system.
Java – Emulates a big endian system
Java – Let’s you inspect the underlying chip with java.nio.ByteOrder.nativeOrder()
C# – System.BitConverter.IsLittleEndian
C# – IPAddress.HostToNetworkOrder
SHA One way hash
C# – System.Security.Cryptography.SHA256Managed
Java – java.security.MessageDigest

Leave a Reply

You must be logged in to post a comment.