mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
all: update repo to use the new error handling syntax (#8950)
This commit is contained in:
@@ -110,7 +110,7 @@ pub fn (mut d Digest) checksum() []byte {
|
||||
tmp[0] = 0x80
|
||||
pad := ((55 - d.len) % 64) // calculate number of padding bytes
|
||||
binary.little_endian_put_u64(mut tmp[1 + pad..], d.len << 3) // append length in bits
|
||||
d.write(tmp[..1 + pad + 8]) or { panic(err) }
|
||||
d.write(tmp[..1 + pad + 8]) or { panic(err.msg) }
|
||||
// The previous write ensures that a whole number of
|
||||
// blocks (i.e. a multiple of 64 bytes) have been hashed.
|
||||
if d.nx != 0 {
|
||||
@@ -127,7 +127,7 @@ pub fn (mut d Digest) checksum() []byte {
|
||||
// sum returns the MD5 checksum of the data.
|
||||
pub fn sum(data []byte) []byte {
|
||||
mut d := new()
|
||||
d.write(data) or { panic(err) }
|
||||
d.write(data) or { panic(err.msg) }
|
||||
return d.checksum()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user