| 1 | // Copyright (c) 2019-2024 Alexander Medvednikov. All rights reserved. |
| 2 | // Use of this source code is governed by an MIT license |
| 3 | // that can be found in the LICENSE file. |
| 4 | module hash |
| 5 | |
| 6 | pub interface Hash { |
| 7 | mut: |
| 8 | // Sum appends the current hash to b and returns the resulting array. |
| 9 | // It does not change the underlying hash state. |
| 10 | sum(b []u8) []u8 |
| 11 | size() int |
| 12 | block_size() int |
| 13 | free() |
| 14 | reset() |
| 15 | write(p []u8) !int |
| 16 | } |
| 17 | |
| 18 | interface Hash32er { |
| 19 | sum32() u32 |
| 20 | } |
| 21 | |
| 22 | interface Hash64er { |
| 23 | sum64() u64 |
| 24 | } |
| 25 | |