mirror of
https://github.com/rclone/rclone.git
synced 2025-01-10 16:28:30 +01:00
a4f1f3d4e8
This fixes a regression in the rclone tests from the v1.0.6 upgrade of uplink. The failure was due to an improperly converted error resulting in the wrong type of error.
24 lines
409 B
Go
24 lines
409 B
Go
// Copyright (C) 2019 Storj Labs, Inc.
|
|
// See LICENSE for copying information.
|
|
|
|
// +build !stdsha256
|
|
|
|
package pkcrypto
|
|
|
|
import (
|
|
"hash"
|
|
|
|
"github.com/minio/sha256-simd"
|
|
)
|
|
|
|
// 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[:]
|
|
}
|