Code example for HashCode

Methods: asBytes

0
      byte[] keyBlob = keyBlob(publicExponent, modulus);
      return hexColonDelimited(Hashing.md5().hashBytes(keyBlob));
   } 
 
   private static String hexColonDelimited(HashCode hc) {
      return on(':').join(fixedLength(2).split(base16().lowerCase().encode(hc.asBytes())));
   } 
 
   private static byte[] keyBlob(BigInteger publicExponent, BigInteger modulus) {
      try { 
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         writeLengthFirst("ssh-rsa".getBytes(), out);
         writeLengthFirst(publicExponent.toByteArray(), out);
         writeLengthFirst(modulus.toByteArray(), out);
         return out.toByteArray();
      } catch (IOException e) {
         throw propagate(e);
      } 
   }