Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
saeedeyvazy opened this issue Jul 20, 2019 · 0 comments
Open

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

saeedeyvazy opened this issue Jul 20, 2019 · 0 comments

Comments

@saeedeyvazy
Copy link

saeedeyvazy commented Jul 20, 2019

I have different results in java and js code when using HmacSha1 method. in java code, my message type is long and message type in js code is string. I think that problem is the different types for message. so how to solve 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?

in js my result is : E79B8A3926C18E7459AD029EF7F9424A42BBDBB2
and in java is :ae88dd66cd58b91ade558629793c1f3346387b79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant