简体   繁体   中英

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM