Merge branch '8784-dir-listings'
[arvados.git] / sdk / go / arvados / keep_block.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: Apache-2.0
4
5 package arvados
6
7 import (
8         "strconv"
9         "strings"
10 )
11
12 // SizedDigest is a minimal Keep block locator: hash+size
13 type SizedDigest string
14
15 // Size returns the size of the data block, in bytes.
16 func (sd SizedDigest) Size() int64 {
17         n, _ := strconv.ParseInt(strings.Split(string(sd), "+")[1], 10, 64)
18         return n
19 }