1// Copyright (C) 2020 Storj Labs, Inc.
2// See LICENSE for copying information.
3
4package pkcrypto
5
6import (
7	"crypto/sha256"
8	"hash"
9)
10
11// NewHash returns default hash in storj.
12func NewHash() hash.Hash {
13	return sha256.New()
14}
15
16// SHA256Hash calculates the SHA256 hash of the input data.
17func SHA256Hash(data []byte) []byte {
18	sum := sha256.Sum256(data)
19	return sum[:]
20}
21