PsychComputeSHA

>Psychtoolbox>PsychBasic

hash = PsychComputeSHA(msg [, shaId=’256’]) – Return the SHA hash of a string.

This uses either GNU/Octave’s builtin hash() function, or if that doesn’t exist,
e.g., on Matlab or old Octave versions, falls back to Java’s MessageDigest
hashing classes to do the same in a slightly less efficient way.

‘msg’ should be a string of which the hash should be computed and returned.

‘shaId’ optional string with numbers, selecting one of the supported SHA
functions. This defaults to SHA-256, ie. shaId == ‘256’, if omitted.

Currently the following shaId’s are supported by both Octave and Matlab:
‘1’, ‘224’, ‘256’, ‘384’, ‘512’

Returns ‘hash’ as the string with the returned SHA hash.

Path   Retrieve current version from GitHub | View changelog
Psychtoolbox/PsychBasic/PsychComputeSHA.m