Caligatio / jsSHA

A JavaScript/TypeScript implementation of the complete Secure Hash Standard (SHA) family (SHA-1, SHA-224/256/384/512, SHA3-224/256/384/512, SHAKE128/256, cSHAKE128/256, and KMAC128/256) with HMAC.

Home Page:https://caligatio.github.io/jsSHA/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

backwards compatibility question

idavollen opened this issue · comments

Hei,

I used to use the old version 1.6.2 of jsSHA

    var shaObj = new jsSHA(value, 'ASCII');
    var hash = shaObj.getHash('SHA-256', 'B64');

now I've upgraded to version 2.2.0

    let shaObj = new jsSHA('SHA-256', 'TEXT');
    shaObj.update(value);
    let hash = shaObj.getHash('HEX');

However, for the same value as input, the generated hash values are different from version to version. Is there anything wrong my usage of jsSHA or it's a break of compatibility between versions?

Thanks in advance!

it's my wrong usage!