public static MessageDigest digest(String algorithm) {
        final Matcher matcher = WITH_PATTERN.matcher(algorithm);
        final String digestAlgorithm = matcher.matches() ? matcher.group(1) : algorithm;
        try {
            return MessageDigest.getInstance(digestAlgorithm);
        } catch (NoSuchAlgorithmException e) {
            throw new CryptoException("Invalid algorithm", e);
        }
    }
@Test
    public void digestUsingObjectIdentifier() {
        assertEquals("SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS",
            Hex.toHexString(DigestUtils.digest("2.16.840.1.101.3.4.2.1").digest(new byte[0]))
        );
    }