04-05-2018 08:18
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-05-2018 08:18
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Hi,
I'm struggling to import jsSHA into my project. I've tried several different ways and also read about how FitBit OS is far away from standard Javascript.
Any help would be appreciated!
Thanks,
JumpMaster
Answered! Go to the Best Answer.

Accepted Solutions
04-10-2018 16:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-10-2018 16:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I used npm and browserify to import jsSHA. You can see the resulting file here:
https://github.com/Lixxia/fitbit-authenticator/blob/master/common/sha.js
Hope this helps!

04-05-2018 08:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-05-2018 08:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-10-2018 16:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-10-2018 16:57
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I used npm and browserify to import jsSHA. You can see the resulting file here:
https://github.com/Lixxia/fitbit-authenticator/blob/master/common/sha.js
Hope this helps!

04-13-2018 01:04
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-13-2018 01:04
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
That's massively helpful. I created QuickAuth for Pebble and was going to create it for FitBit. Your app looks great. Is the FitBit really not capable of generating the codes locally?

04-13-2018 06:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-13-2018 06:15
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Awesome! I came from pebble so the missing authenticator was a big deal for me 😛
I originally wrote the app to keep everything on the watch, however when first testing it on a Versa the code generation (for one token) took a good 5-7 seconds if not more, freezing the watch during that time. Adding any more tokens would increase the calculation time by several additional seconds. Speaking to the devs on the discord I was informed that the device wasn't really optimized for crypto calculations like SHA/HMAC.
Since this is written in JS instead of C I was doubtful I could optimize the code to the point that I could leave it on the watch, so I decided to move all the calculations to the phone to keep it as snappy as possible.

04-13-2018 06:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-13-2018 06:54
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Wow it's shocking that a watch made six years ago can out perform the Versa. That's a shame.
If I find a way to do it I'll let you know but I'm not hopeful. I copy and pasted the SHA1 code on the Pebble straight from Google last time 🙂

04-13-2018 07:05
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-13-2018 07:05
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Agreed, it was very disappointing when I first tested it out 😞
Definitely keep me updated, and good luck!

04-13-2018 10:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-13-2018 10:09
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
Have you opened a feature request? 😛

04-28-2018 07:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

04-28-2018 07:55
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
- Who Voted for this post?
Feature request opened here.
