mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
hash: make public the hash.Hash interface, add tests to current implementers (#21984)
This commit is contained in:
parent
e906033e4e
commit
1a8eff8d2b
5 changed files with 33 additions and 1 deletions
|
@ -2,6 +2,14 @@
|
|||
// Use of this source code is governed by an MIT license
|
||||
// that can be found in the LICENSE file.
|
||||
import crypto.sha256
|
||||
import hash
|
||||
|
||||
// verify sha256.Digest implements hash.Hash
|
||||
fn test_digest_implements_hash() {
|
||||
get_digest := fn () hash.Hash {
|
||||
return sha256.new()
|
||||
}
|
||||
}
|
||||
|
||||
fn test_crypto_sha256() {
|
||||
assert sha256.sum('This is a sha256 checksum.'.bytes()).hex() == 'dc7163299659529eae29683eb1ffec50d6c8fc7275ecb10c145fde0e125b8727'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue