storj/pkg/pkcrypto/hashing.go
Egon Elbre 05d148aeb5
Storage node and upload/download protocol refactor (#1422)
refactor storage node server
refactor upload and download protocol
2019-03-18 12:55:06 +02:00

19 lines
369 B
Go

// Copyright (C) 2019 Storj Labs, Inc.
// See LICENSE for copying information.
package pkcrypto
import (
"crypto/sha256"
"hash"
)
// NewHash returns default hash in storj.
func NewHash() hash.Hash { return sha256.New() }
// SHA256Hash calculates the SHA256 hash of the input data
func SHA256Hash(data []byte) []byte {
sum := sha256.Sum256(data)
return sum[:]
}