Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass number to crypto-js hmac sha1 method?

I have different results in java and js code when using HmacSha1 method. after spend time to searching, I found that maybe my message should passed as a number to HmacSha1 method. so how to do this? this is my code :

import Crypto from "crypto-js";

 Crypto.HmacSHA1(
   "26056085",
   Crypto.enc.Hex.parse("0899917B8146FFE4")
 );

so, how to send "26056085" as a number message? Also i know that this method parameters accepts string type. maybe this link can help you for help me.

like image 685
saeed eivazi Avatar asked Oct 15 '25 14:10

saeed eivazi


1 Answers

After more trying, we have to generate HmacSha1 in native code (swift). so we used react native bridge communication between react native and swift. this link can help you.

like image 117
saeed eivazi Avatar answered Oct 18 '25 08:10

saeed eivazi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!