OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. |
| 4 |
| 5 package main |
| 6 |
| 7 import ( |
| 8 "io" |
| 9 |
| 10 "github.com/luci/luci-go/common/isolated" |
| 11 ) |
| 12 |
| 13 func hash(src io.Reader) (isolated.HexDigest, uint64, error) { |
| 14 h := isolated.GetHash() |
| 15 bytes, err := io.Copy(h, src) |
| 16 if err != nil { |
| 17 return isolated.HexDigest(""), 0, err |
| 18 } |
| 19 return isolated.Sum(h), uint64(bytes), nil |
| 20 } |
OLD | NEW |