Java – Convert IP address to Decimal Number
In this tutorial, we show you how to convert an IP address to its decimal equivalent in Java, and vice versa. We show you two ways to convert an IP…
Java MD5 Hashing Example
The MD5, defined in RFC 1321, is a hash algorithm to turn inputs into a fixed 128-bit (16 bytes) length of the hash value. In Java, we can use MessageDigest…
Java – Convert String to Binary
This article shows you five examples to convert a string into a binary string representative or vice verse. Convert String to Binary – Integer.toBinaryString. Convert String to Binary – Bit…
Java – Convert Integer to Binary
In Java, we can use Integer.toBinaryString(int) to convert an Integer to a binary string representative. Integer.java This article will show you two methods to convert an Integer to a binary…
How to reverse a string in Java
In this article, we will show you a few ways to reverse a String in Java. StringBuilder(str).reverse(), char looping and value swapping. byte looping and value swapping. Apache commons-lang3. For…
Java – How to convert byte arrays to Hex
This article shows you a few ways to convert byte arrays or byte to a hexadecimal (base 16 or hex) string representative. String.format, Integer.toHexString, Apache Commons Codec – commons-codec, Spring…
Java Sign Extension
The sign extension is an operation of increasing the bits while preserves the number’s sign (positive and negative). The Sign extension fills the increased bits with the original of the…
Java >> and >>> bitwise shift operators
In programming, bitwise shift operators, >> means arithmetic right shift, >>> means logical right shift, the differences: >>, it preserves the sign (positive or negative numbers) after right shift by…
Java SHA-256 and SHA3-256 Hashing Example
In Java, we can use MessageDigest to get a SHA-256 or SHA3-256 hashing algorithm to hash a string. This article shows how to use Java SHA-256 and SHA3-256 algorithms to…
Maven – How to create a Java project
In this tutorial, we will show you how to use Maven to manage a Java project – create, add dependencies and package a Java project into an executable jar file.…