~john-koepi/ubuntu/trusty/golang/default

« back to all changes in this revision

Viewing changes to src/pkg/hash/fnv/fnv.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
        "encoding/binary"
12
12
        "hash"
13
13
        "os"
14
 
        "unsafe"
15
14
)
16
15
 
17
16
type (
102
101
        return len(data), nil
103
102
}
104
103
 
105
 
func (s *sum32) Size() int  { return unsafe.Sizeof(*s) }
106
 
func (s *sum32a) Size() int { return unsafe.Sizeof(*s) }
107
 
func (s *sum64) Size() int  { return unsafe.Sizeof(*s) }
108
 
func (s *sum64a) Size() int { return unsafe.Sizeof(*s) }
 
104
func (s *sum32) Size() int  { return 4 }
 
105
func (s *sum32a) Size() int { return 4 }
 
106
func (s *sum64) Size() int  { return 8 }
 
107
func (s *sum64a) Size() int { return 8 }
109
108
 
110
109
func (s *sum32) Sum() []byte {
111
 
        a := make([]byte, unsafe.Sizeof(*s))
 
110
        a := make([]byte, 4)
112
111
        binary.BigEndian.PutUint32(a, uint32(*s))
113
112
        return a
114
113
}
115
114
 
116
115
func (s *sum32a) Sum() []byte {
117
 
        a := make([]byte, unsafe.Sizeof(*s))
 
116
        a := make([]byte, 4)
118
117
        binary.BigEndian.PutUint32(a, uint32(*s))
119
118
        return a
120
119
}
121
120
 
122
121
func (s *sum64) Sum() []byte {
123
 
        a := make([]byte, unsafe.Sizeof(*s))
 
122
        a := make([]byte, 8)
124
123
        binary.BigEndian.PutUint64(a, uint64(*s))
125
124
        return a
126
125
}
127
126
 
128
127
func (s *sum64a) Sum() []byte {
129
 
        a := make([]byte, unsafe.Sizeof(*s))
 
128
        a := make([]byte, 8)
130
129
        binary.BigEndian.PutUint64(a, uint64(*s))
131
130
        return a
132
131
}