File: sha_url.Rd

package info (click to toggle)
r-cran-downloader 0.3-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 112 kB
  • ctags: 3
  • sloc: makefile: 6
file content (31 lines) | stat: -rw-r--r-- 1,088 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
\name{sha_url}
\alias{sha_url}
\title{Download a file from a URL and find a SHA-1 hash of it}
\usage{
  sha_url(url, cmd = TRUE)
}
\arguments{
  \item{url}{The URL of the file to find a hash of.}

  \item{cmd}{If \code{TRUE} (the default), print out a
  command for sourcing the URL with
  \code{\link{source_url}()}, including the hash.}
}
\description{
  This will download a file and find a SHA-1 hash of it,
  using \code{\link{digest}()}. The primary purpose of this
  function is to provide an easy way to find the value of
  \code{sha} which can be passed to
  \code{\link{source_url}()}.
}
\examples{
\dontrun{
# Get the SHA hash of a file. It will print the text below and return
# the hash as a string
sha_url("https://gist.github.com/wch/dae7c106ee99fe1fdfe7/raw/db0c9bfe0de85d15c60b0b9bf22403c0f5e1fb15/test.r")
# Command for sourcing the URL:
#  downloader::source_url("https://gist.github.com/wch/dae7c106ee99fe1fdfe7/raw/db0c9bfe0de85d15c60b0b9bf22403c0f5e1fb15/test.r", sha="9b8ff5213e32a871d6cb95cce0bed35c53307f61")
# [1] "9b8ff5213e32a871d6cb95cce0bed35c53307f61"
}
}