private static UUID computeUUID(MessageDigest md) {
        byte[] sha1Bytes = md.digest();
        sha1Bytes[6] &= 0x0f;  /* clear version        */
        sha1Bytes[6] |= 0x50;  /* set to version 5     */
        sha1Bytes[8] &= 0x3f;  /* clear variant        */
        sha1Bytes[8] |= 0x80;  /* set to IETF variant  */

        // SHA generates 160 bytes; truncate to 128
        long msb = 0;
        //assert data.length == 16 || data.length == 20;
        for (int i = 0; i < 8; i++) {
            msb = (msb << 8) | (sha1Bytes[i] & 0xff);
        }
        long lsb = 0;
        for (int i = 8; i < 16; i++) {
            lsb = (lsb << 8) | (sha1Bytes[i] & 0xff);
        }
        return new UUID(msb, lsb);
    }
Computes the uuid.
@param md the message digest used to compute the hash
@return the eTag as a type 5 uuid
standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/properties/Digester.java