dwyl / time-apple-watch-app

:watch: The app on your wrist that keeps you on track!
9 stars 0 forks source link

Investigate SHA256 Hashing on iOS (Swift) #84

Open nelsonic opened 7 years ago

nelsonic commented 7 years ago

It appears to be possible to create a SHA256 Hash in Swift: https://stackoverflow.com/questions/25388747/sha256-in-swift

Todo

Background Reading

Note: the reason for using a SHA256 instead of another hashing algorithm is: https://github.com/dwyl/learn-cryptography/issues/2

nelsonic commented 7 years ago

@sohilpandya please remember to add a Time Estimate to issues before diving in. 😉

sohilpandya commented 7 years ago

Thanks for that @nelsonic.

I've estimated 1.5 days for this, already spent ~3 hours on the first couple if items alongside the background reading. :)

update

sohilpandya commented 7 years ago

@nelsonic wanted a clarification on the following point:

Use the Hash as the ID in SQL-Lite DB locally on device

At this moment we are storing the following information in core data:

screen shot 2017-06-23 at 10 35 48 1

I will be adding an additional field in the core data called id which will contain the hash.

Now when the user stops a timer, we are updating this item in the core data, would we update the hash too? as at the moment, the user starts a timer the hash contains the following infomation

{
  "project_name": "iOS",
  "start_date": "Stringified Date",
  "isTaskRunning": "true"
}

But when the timer is stopped it should have an additional field of "end_date":"Stringified Date"

This will mean that the hash will be different when the timer is started and when the timer is stopped.

nelsonic commented 7 years ago

@sohilpandya apologies if this is unclear. no, we are not updating the hash we are going to save a new revision. I am working on NHS today, but as soon as I have some time spare I will document exactly how this needs to work on both iOS and PWA so it's much clearerer. 👍

Meanwhile could you please write-up a "complete beginners" intro to automated UI testing in: https://github.com/dwyl/learn-apple-watch-development/ thanks! 🎉

sohilpandya commented 7 years ago

Thanks for that! I'll probably like to catch up about it early Monday morning if we can, I will look into https://github.com/dwyl/learn-apple-watch-development/issues/40 for the time being. 👍

sohilpandya commented 7 years ago

@nelsonic can we catch up at some point today to talk about this?

nelsonic commented 7 years ago

@sohilpandya dang. only saw this now... I expect to do some work on this on the train on Thursday. we should setup a hangout to catchup. 👍

sohilpandya commented 7 years ago

Hey @nelsonic That would be awesome, I'm planning to start working full steam from tomorrow so be great if we could catch up first thing tomorrow if that is possible?

sohilpandya commented 7 years ago

We only have one table, some of the main bits of information it contains:

core data
project_name
task_start_date
task_end_date
is_running

Here is the current flow of all the times we are storing to the core data