test_class.file: ndbc-postgres/src/test/java/io/trane/ndbc/postgres/util/MD5DigestTest.java
test_class.identifier: MD5DigestTest
test_case.body: @Test
    public void encode() {
      final Charset charset = Charset.forName("UTF-8");
      final byte[] user = "foo".getBytes(charset);
      final byte[] password = "bar".getBytes(charset);
      final byte[] salt = "baz".getBytes(charset);
  
      final byte[] encoded = MD5Digest.encode(user, password, salt);
      assertEquals("md50143bd10979e4bd058f050b64eeb31ba", new String(encoded, charset));
    }
test_case.class_method_signature: MD5DigestTest.encode()
test_case.full_signature: @Test public void encode()
test_case.identifier: encode
test_case.invocations: forName getBytes getBytes getBytes encode assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void encode()
focal_class.file: ndbc-postgres/src/main/java/io/trane/ndbc/postgres/util/MD5Digest.java
focal_class.identifier: MD5Digest
focal_class.class_method_signature: MD5Digest.MD5Digest()
focal_class.full_signature: private  MD5Digest()
focal_class.identifier: MD5Digest
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  MD5Digest()
focal_class.class_method_signature: MD5Digest.encode(final byte user[], final byte password[], final byte salt[])
focal_class.full_signature: public static final byte[] encode(final byte user[], final byte password[], final byte salt[])
focal_class.identifier: encode
focal_class.modifiers: public static final
focal_class.parameters: (final byte user[], final byte password[], final byte salt[])
focal_class.return: byte[]
focal_class.signature: byte[] encode(final byte user[], final byte password[], final byte salt[])
focal_class.class_method_signature: MD5Digest.bytesToHex(final byte[] bytes, final byte[] hex, final int offset)
focal_class.full_signature: private static final void bytesToHex(final byte[] bytes, final byte[] hex, final int offset)
focal_class.identifier: bytesToHex
focal_class.modifiers: private static final
focal_class.parameters: (final byte[] bytes, final byte[] hex, final int offset)
focal_class.return: void
focal_class.signature: void bytesToHex(final byte[] bytes, final byte[] hex, final int offset)
focal_method.body: public static final byte[] encode(final byte user[], final byte password[], final byte salt[]) {
      MessageDigest md;
      byte[] temp_digest;
      byte[] pass_digest;
      final byte[] hex_digest = new byte[35];
  
      try {
        md = MessageDigest.getInstance("MD5");
  
        md.update(password);
        md.update(user);
        temp_digest = md.digest();
  
        bytesToHex(temp_digest, hex_digest, 0);
        md.update(hex_digest, 0, 32);
        md.update(salt);
        pass_digest = md.digest();
  
        bytesToHex(pass_digest, hex_digest, 3);
        hex_digest[0] = (byte) 'm';
        hex_digest[1] = (byte) 'd';
        hex_digest[2] = (byte) '5';
      } catch (final NoSuchAlgorithmException e) {
        throw new IllegalStateException("Unable to encode password with MD5", e);
      }
  
      return hex_digest;
    }
focal_method.class_method_signature: MD5Digest.encode(final byte user[], final byte password[], final byte salt[])
focal_method.full_signature: public static final byte[] encode(final byte user[], final byte password[], final byte salt[])
focal_method.identifier: encode
focal_method.invocations: getInstance update update digest bytesToHex update update digest bytesToHex
focal_method.modifiers: public static final
focal_method.parameters: (final byte user[], final byte password[], final byte salt[])
focal_method.return: byte[]
focal_method.signature: byte[] encode(final byte user[], final byte password[], final byte salt[])