hash: add more methods to the hash.Hash interface, to match the ones in Go (#22001)

This commit is contained in:
Coachonko 2024-08-07 18:53:57 +02:00 committed by GitHub
parent 79ee4ae046
commit 258aed44fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,11 +4,15 @@
module hash module hash
pub interface Hash { pub interface Hash {
mut:
// Sum appends the current hash to b and returns the resulting array. // Sum appends the current hash to b and returns the resulting array.
// It does not change the underlying hash state. // It does not change the underlying hash state.
sum(b []u8) []u8 sum(b []u8) []u8
size() int size() int
block_size() int block_size() int
free()
reset()
write(p []u8) !int
} }
interface Hash32er { interface Hash32er {