/
lsh512.go
79 lines (55 loc) · 1.09 KB
/
lsh512.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package hash
import (
"github.com/deatil/go-hash/lsh512"
)
// LSH512
func (this Hash) LSH512() Hash {
h := lsh512.New()
h.Write(this.data)
this.data = h.Sum(nil)
return this
}
// NewLSH512
func (this Hash) NewLSH512() Hash {
this.hash = lsh512.New()
return this
}
// ===========
// LSH512_384
func (this Hash) LSH512_384() Hash {
h := lsh512.New384()
h.Write(this.data)
this.data = h.Sum(nil)
return this
}
// NewLSH512_384
func (this Hash) NewLSH512_384() Hash {
this.hash = lsh512.New384()
return this
}
// ===========
// LSH512_256
func (this Hash) LSH512_256() Hash {
h := lsh512.New256()
h.Write(this.data)
this.data = h.Sum(nil)
return this
}
// NewLSH512_256
func (this Hash) NewLSH512_256() Hash {
this.hash = lsh512.New256()
return this
}
// ===========
// LSH512_224
func (this Hash) LSH512_224() Hash {
h := lsh512.New224()
h.Write(this.data)
this.data = h.Sum(nil)
return this
}
// NewLSH512_224
func (this Hash) NewLSH512_224() Hash {
this.hash = lsh512.New224()
return this
}