Skip to content

Instantly share code, notes, and snippets.

@elin-moco
Last active October 17, 2019 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elin-moco/9fb7fcedbcd9a681f2a450afcf0816ac to your computer and use it in GitHub Desktop.
Save elin-moco/9fb7fcedbcd9a681f2a450afcf0816ac to your computer and use it in GitHub Desktop.
Hash URL with sha256
import hashlib
hashlib.sha256("https://www.flipkart.com/".encode("utf-8")).hexdigest()
@elin-moco
Copy link
Author

elin-moco commented Oct 17, 2019

sample code for hash result validation

>>> hashlib.sha256(“http://bukalapak.go2cloud.org/aff_c?offer_id=15&aff_id=4287&aff_sub=aaa&aff_sub2=bbb&aff_sub3=ccc&aff_sub4=ddd&aff_sub5=eee&url=https%3A%2F%2Fwww.bukalapak.com%2Fpc%2Fsamsung-galaxy-j7-core%3Fho_offer_id%3D{offer_id}%26ho_trx_id%3D{transaction_id}%26affiliate_id%3D{affiliate_id}%26utm_source%3Dhasoffers%26utm_medium%3Daffiliate%26utm_campaign%3D{offer_id}%26aff_sub%3D{aff_sub}%26aff_sub2%3D{aff_sub2}%26aff_sub3%3D{aff_sub3}%26aff_sub4%3D{aff_sub4}%26aff_sub5%3D{aff_sub5}%26ref%3D{referer}“.encode(“utf-8”)).hexdigest()

‘cee6e7b5cf7a911e1eccab525dcfa4217a33b4c45c11bad433ab72770cb2fcce’

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment