Skip to content

Commit 0450142

Browse files
authored
Merge pull request #23 from cjthompson/sha-bug-fix
URGENT FIX: SHA hashing broken on Android for UTF8
2 parents 3eab42a + b1e08e4 commit 0450142

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

android/src/main/java/com/pedrouid/crypto/RCTSha.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void shaBase64(String data, String algorithm, Promise promise) throws Exc
8686
@ReactMethod
8787
public void shaUtf8(String data, String algorithm, Promise promise) throws Exception {
8888
try {
89-
byte[] digest = data.getBytes();
89+
byte[] digest = this.sha(data.getBytes(), algorithm);
9090
promise.resolve(Base64.encodeToString(digest, Base64.DEFAULT));
9191
} catch (Exception e) {
9292
promise.reject("-1", e.getMessage());

0 commit comments

Comments
 (0)