README

checksum

GoDoc Go Report Card test coverage

Compute message digest, like MD5 and SHA256, in golang for potentially large files.

Usage

package main

import (
	"fmt"
	"github.com/codingsince1985/checksum"
)

func main() {
	file := "/home/jerry/Downloads/ubuntu-gnome-16.04-desktop-amd64.iso"
	md5, _ := checksum.MD5sum(file)
	fmt.Println(md5)
	sha256, _ := checksum.SHA256sum(file)
	fmt.Println(sha256)
}

License

checksum is distributed under the terms of the MIT license. See LICENSE for details.

Expand ▾ Collapse ▴

Documentation

Overview

    Package checksum computes checksums, like MD5 or SHA256, for large files

    Index

    Constants

    This section is empty.

    Variables

    This section is empty.

    Functions

    func MD5sum

    func MD5sum(filename string) (string, error)

      MD5sum returns MD5 checksum of filename

      func MD5sumReader

      func MD5sumReader(reader io.Reader) (string, error)

        MD5sumReader returns MD5 checksum of content in reader

        func SHA256sum

        func SHA256sum(filename string) (string, error)

          SHA256sum returns SHA256 checksum of filename

          func SHA256sumReader

          func SHA256sumReader(reader io.Reader) (string, error)

            SHA256sumReader returns SHA256 checksum of content in reader

            Types

            This section is empty.