My go code is producing different sha256sum values than bash commandline. I've read through various questions and answers and they all point to what I've already done, as this community asks me to do before posting
Here's my sha256sum code on go
sha256Key:=verifyEmail+":"+md5password+":"+dateStr
hasherSha256 := sha1.New()
hasherSha256.Write([]byte(sha256Key))
sha256Val:=hex.EncodeToString(hasherSha256.Sum(nil))
And here's my bash
script code:
key=$( echo -n "$verifyEmail:$md5PWD:$pwTime" | sha256sum)
echo $key
Ive already validated that the keys are the same. One note, my dateStr variable inside go comes from date formatting:
now := time.Now().Unix()
rem := now % 3600
date := now-rem
dateStr:=strconv.FormatInt(date,10)
Usually I get downvotes so I tried making this question as clear and concise as possible.
Please let me know if im missing anything.
Thanks