Skip to content

Commit

Permalink
Create hashpage.go
Browse files Browse the repository at this point in the history
To see if a page has changed
  • Loading branch information
aringo authored May 1, 2022
1 parent 8284c99 commit e380870
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions hashpage.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package main

import (
"crypto/sha256"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
)

func main() {
weblocation := os.Args[1]
resp, err := http.Get(weblocation)
if err != nil {
log.Fatalln(err)
}
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatalln(err)
}
h := sha256.Sum256(body)
fmt.Printf("%x", h)
}

0 comments on commit e380870

Please sign in to comment.