Groovy web console

subscribe to the feed Subscribe
to this
site

Untitled

Published 6 months ago by Anonymous
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
import java.security.MessageDigest;
import java.nio.charset.StandardCharsets;
import java.math.BigInteger;

MessageDigest digest = MessageDigest.getInstance("SHA-256");
print  new BigInteger(1, digest.digest("Hello World".getBytes(StandardCharsets.UTF_8))).toString(16);