A
A
akimovpro2012-04-16 13:58:17
macOS
akimovpro, 2012-04-16 13:58:17

How to generate a SHA-256 hash for a string on MacOS?

You need to generate a SHA-256 hash for a variable string from AppleScript. What is the best way to do this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Meliborn, 2012-04-16
@Meliborn

The sha1 command is shorthand for
cksum -a sha1
The cksum(1) command can also be used to compute digests from the SHA-2
family: sha256, sha384 and sha512.

A
akimovpro, 2012-04-17
@akimovpro

Here is the line for SHA-256:
echo -n "какая-то строка" | shasum -a 256

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question